:root {
    --bg-dark: #0a0a0a;
    --bg-card: #151515;
    --bg-hover: #1f1f1f;
    --border-color: #2a2a2a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo .dot {
    color: var(--accent-blue);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.email-pill {
    background-color: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.email-pill:hover {
    background-color: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.icon-button {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: var(--bg-hover);
}

.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: #121212;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 100;
}

.dropdown-menu.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: background 0.2s ease;
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.dropdown-item:hover {
    background-color: var(--bg-hover);
}

/* Main Content */
.inbox-container {
    max-width: 800px;
    width: 100%;
    margin: 4rem auto;
    padding: 0 2rem;
    flex: 1;
}

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inbox-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.inbox-list {
    margin-top: 2rem;
}

.empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.01);
}

.email-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.email-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.email-from {
    font-weight: 500;
    color: var(--text-main);
    font-size: 1rem;
}

.email-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

/* Email Detail View */
.email-detail.hidden {
    display: none;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-family);
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--text-main);
}

.email-detail-header {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 1.5rem;
    border-bottom: none;
}

.email-detail-header h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.email-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.email-detail-body {
    background-color: #ffffff;
    border-radius: 0 0 8px 8px;
    height: 500px;
    overflow: hidden;
}

.email-content-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* Modals and Toasts */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.input-group {
    display: flex;
    align-items: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.input-group input {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    outline: none;
    flex: 1;
    font-family: var(--font-family);
}

.domain-suffix {
    padding: 0.75rem 1rem;
    background-color: var(--bg-card);
    color: var(--text-muted);
    border-left: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-actions button {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
}

.btn-cancel:hover {
    color: var(--text-main);
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-dark);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--text-main);
    color: var(--bg-dark);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
