:root {
    /* Pure White Minimalist Theme */
    --bg-main: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fafafa;
    --bg-input: #f4f4f5;
    --border-color: #e4e4e7;
    --border-hover: #d4d4d8;

    --text-main: #09090b;
    --text-muted: #71717a;

    --accent-primary: #000000;
    --accent-primary-text: #ffffff;
    --accent-secondary: #0070f3;
    --accent-secondary-hover: #0051b3;

    --accent-success: #0070f3;
    /* Using blue for pulse for cleaner look, or #10b981 */
    --accent-danger: #ef4444;
    --accent-danger-bg: #fef2f2;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Visually Hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.background-effects {
    display: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.logo i {
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Control Panel */
.email-control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.email-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 600px) {
    .email-box {
        flex-direction: row;
        align-items: center;
    }
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.email-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

#email-address {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 1.15rem 1rem 1.15rem 3.25rem;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 600;
    font-family: 'Inter', monospace;
    outline: none;
    transition: var(--transition);
}

#email-address:focus {
    border-color: var(--border-hover);
    background: var(--bg-main);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.spinner {
    position: absolute;
    right: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.spinner.show {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    flex: 1;
}

@media (min-width: 600px) {
    .btn {
        flex: none;
    }
}

.primary-btn {
    background: var(--accent-primary);
    color: var(--accent-primary-text);
}

.primary-btn:hover {
    background: #333333;
}

.secondary-btn {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid transparent;
}

.secondary-btn:hover {
    background: #e4e4e7;
}

.danger-btn {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
    border: 1px solid transparent;
}

.danger-btn:hover {
    background: #fee2e2;
}

.domain-control {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.domain-control label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.domain-select {
    flex: 1;
    background: transparent;
    color: var(--text-main);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.qr-code-toggle {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
}

.qr-code-toggle:hover {
    color: var(--text-main);
}

.qr-code-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.qr-code-container img {
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    max-width: 140px;
}

.hidden {
    display: none !important;
}

/* Inbox Section */
.inbox-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    box-shadow: var(--shadow-sm);
}

.inbox-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.inbox-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-success);
    border-radius: 50%;
    opacity: 0.6;
}

.inbox-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon-wrapper {
    position: relative;
    font-size: 3rem;
    color: var(--border-hover);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 300px;
    line-height: 1.6;
}

/* Email List */
.email-list {
    display: flex;
    flex-direction: column;
}

.email-item {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.email-item:last-child {
    border-bottom: none;
}

.email-item:hover {
    background: var(--bg-card-hover);
}

.email-sender-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.email-preview {
    flex: 1;
    min-width: 0;
}

.email-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.email-sender {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}

.email-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.email-subject {
    font-size: 0.95rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* SEO Content & Blog Section */
.seo-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.blog-card {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.blog-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.blog-icon {
    display: none;
}

.blog-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.blog-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.blog-text p:last-child {
    margin-bottom: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-main);
    width: 100%;
    max-width: 800px;
    height: 100vh;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 800px) {
    .modal-content {
        height: 85vh;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--accent-secondary);
}

.icon-btn {
    background: transparent;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    color: var(--text-main);
    background: var(--bg-input);
}

.danger-text:hover {
    color: var(--accent-danger);
}

.email-reader-meta {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: var(--bg-main);
}

.sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.meta-details {
    flex: 1;
}

.reader-subject {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    word-break: break-word;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.reader-info {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.from-label {
    font-weight: 500;
}

.reader-from {
    color: var(--text-main);
}

.reader-date {
    margin-left: auto;
}

.email-reader-body {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    color: #000000;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Because JS adds this class acting as a fallback for text emails */
.email-reader-body.dark-content {
    background: var(--bg-main);
    color: var(--text-main);
    padding: 2rem;
}

.email-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

.modal-spinner {
    margin: 4rem auto;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 50%;
    transform: translateX(50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: #000000;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    /* Pill shape */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.1rem;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 3rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-main);
}

.app-footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Max Width Mobile Responsiveness adjustments */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1rem;
        gap: 2rem;
    }

    .email-control-panel {
        padding: 1.5rem;
    }

    .actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .btn {
        width: 100%;
    }

    #email-address {
        font-size: 1.05rem;
        padding: 1rem 1rem 1rem 2.8rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    .modal-content {
        border-radius: 0;
        height: 100vh;
    }
}

/* Minimal Responsive Header Styles */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap; /* Allows stacking on small screens */
}

@media (max-width: 600px) {
    .nav-header {
        flex-direction: column;
        text-align: center;
    }
    
    .app-header {
        padding: 0 1rem;
    }
}
/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: none; /* Hidden by default (desktop) */
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition);
    gap: 4px;
    flex: 1;
}

.bottom-nav-link i {
    font-size: 1.25rem;
}

.bottom-nav-link.active {
    color: var(--accent-secondary);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
    
    body {
        padding-bottom: 70px; /* Space for bottom nav */
    }
}