:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --success: #22c55e;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    z-index: -1;
    pointer-events: none;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: -0.05em;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 2rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
    /* Changed from height to min-height to allow scrolling */
    display: flex;
    gap: 2rem;
}

/* Layout */
.email-app {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    width: 100%;
    height: calc(100vh - 160px);
    /* Fixed height for the app view */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* Left Sidebar */
.sidebar {
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.email-address-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-email {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--accent-color);
    word-break: break-all;
}

.timer {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timer-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    background: var(--accent-color);
    transition: width 1s linear;
}

.email-list {
    flex: 1;
    overflow-y: auto;
}

.email-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s;
}

.email-item:hover,
.email-item.active {
    background: rgba(255, 255, 255, 0.05);
}

.email-sender {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.email-subject {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right Content */
.email-content {
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.content-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.content-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.content-subject {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.content-body {
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    /* Preserve basic text formatting */
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.email-item,
.email-content {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        height: auto;
        display: block;
    }

    .email-app {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 80vh;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        max-height: 40vh;
    }

    .email-content {
        min-height: 50vh;
    }
}

/* Cookie Consent Overlay */
.cookie-banner {
    display: none;
    /* Controlled by JS */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    /* Backdrop dimming */
    z-index: 9999;
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.cookie-content {
    background: #1e293b;
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.cookie-content h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.cookie-content p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cookie-content button {
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.cookie-content button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .cookie-banner {
        left: 1rem;
        left: 50%;
        /* Center horizontally */
        transform: translateX(-50%);
        /* Adjust for centering */
        bottom: 1rem;
        max-width: calc(100% - 2rem);
        /* Allow it to be a card, but with padding */
        width: auto;
        /* Let content define width up to max-width */
    }
}