@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg:         #0a0a0f;
    --surface:    #12121a;
    --surface2:   #1c1c2e;
    --accent:     #00ff88;
    --accent-glow: rgba(0, 255, 136, 0.3);
    --accent2:    #7c3aed;
    --text:       #e2e8f0;
    --text-muted: #64748b;
    --danger:     #ff4757;
    --border:     rgba(255,255,255,0.07);
    --font-mono: 'Space Mono', monospace;
    --font-sans: 'DM Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header/Hero */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background: radial-gradient(circle at center, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logo span { color: var(--text); }

.address-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.address-display {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent);
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    word-break: break-all;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px inset rgba(255,255,255,0.05);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background: var(--accent);
    margin-left: 5px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-weight: 700;
}

.btn-primary:hover {
    background: #00e67a;
    box-shadow: 0 0 20px var(--accent-glow);
}

.timer-container {
    margin-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

#timer { color: var(--accent); font-weight: 700; }
#timer.warning { color: #f1c40f; }
#timer.danger { color: var(--danger); }

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--surface2);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

#progress-bar {
    height: 100%;
    background: var(--accent);
    width: 100%;
    transition: width 1s linear;
}

/* Inbox Section */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .main-content { grid-template-columns: 350px 1fr; }
}

.inbox-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.email-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.email-item:hover {
    background: var(--surface2);
    border-left-color: var(--accent);
}

.email-item.active {
    background: rgba(124, 58, 237, 0.1);
    border-left-color: var(--accent2);
}

.email-item.unread {
    font-weight: 700;
}

.email-item.unread::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-right: 8px;
}

.email-sender {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.email-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Empty State */
.empty-inbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Viewer Section */
.viewer-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.viewer-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

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

.message-subject {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.message-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}

.meta-label { color: var(--text-muted); }

.message-body {
    padding: 1.5rem;
    flex: 1;
    background: #fff; /* For readability of standard emails */
    margin: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.message-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--surface2);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: var(--text);
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Domain Selector */
.domain-select {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.domain-select option {
    background: var(--surface2);
    color: var(--text);
}

/* QR Modal */
.qr-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface2);
    padding: 2rem;
    border: 1px solid var(--accent);
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.qr-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-image {
    background: #fff;
    padding: 10px;
    border-radius: 8px;
}
