/* ─────────────────────────────────────────────────────
   Mailnator — Main Stylesheet
   Dark navy nav, light backgrounds, clean table design
   Inspired by mailinator.com's aesthetic
   ───────────────────────────────────────────────────── */

/* ── Reset & Base ────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --navy: #1e2a38;
    --navy-light: #2a3a4e;
    --navy-dark: #151f2b;
    --teal: #2eaa8a;
    --teal-hover: #259e7e;
    --teal-glow: rgba(46, 170, 138, 0.15);
    --blue-accent: #3b82f6;
    --blue-accent-light: #60a5fa;
    --sidebar-bg: #f0f2f5;
    --body-bg: #f7f8fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f0f1f3;
    --hover-bg: #f9fafb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--blue-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--blue-accent-light);
}

/* ── Top Utility Bar ─────────────────────────────────── */
.top-bar {
    background: var(--navy-dark);
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-search {
    display: flex;
    align-items: center;
    gap: 0;
}

.top-search input {
    background: #fff;
    border: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-family: inherit;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    width: 260px;
    outline: none;
}

.top-search input::placeholder {
    color: var(--text-muted);
}

.top-bar-link {
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.85;
    transition: opacity var(--transition);
}

.top-bar-link:hover {
    opacity: 1;
    color: #fff;
}

/* ── Navigation Bar ──────────────────────────────────── */
.navbar {
    background: var(--navy);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-brand:hover {
    color: #fff;
}

.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--teal);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 0;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: #fff;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn-go {
    background: var(--teal);
    color: #fff;
    border: none;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: background var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-go:hover {
    background: var(--teal-hover);
}

.btn-go-large {
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-icon {
    background: none;
    border: 2px solid var(--border-color);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.btn-icon:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.btn-delete {
    background: none;
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}

.btn-delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.btn-back {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--blue-accent);
    transition: color var(--transition);
}

.btn-back:hover {
    color: var(--blue-accent-light);
}

.btn-download {
    display: inline-block;
    padding: 4px 12px;
    background: var(--teal);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background var(--transition);
}

.btn-download:hover {
    background: var(--teal-hover);
    color: #fff;
}

/* ── Icons ───────────────────────────────────────────── */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Page Layout ─────────────────────────────────────── */
.page-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 64px - 40px - 60px);
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.recent-list {
    list-style: none;
}

.recent-list li {
    margin-bottom: 4px;
}

.recent-list li a {
    display: block;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--blue-accent);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
}

.recent-list li a:hover {
    background: rgba(59, 130, 246, 0.08);
}

.empty-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
    padding: 6px 12px;
}

/* ── Main Content ────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 32px 40px;
    max-width: 1100px;
}

/* ── Hero Section (Homepage) ─────────────────────────── */
.hero {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 60px 0 80px;
    max-width: 1000px;
    margin: 0 auto;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--teal), var(--blue-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.hero-search {
    width: 100%;
}

.hero-input-group {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.hero-input-group:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px var(--teal-glow), var(--shadow-md);
}

.hero-input-group input {
    flex: 1;
    border: none;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-family: inherit;
    outline: none;
    background: transparent;
}

.hero-input-group input::placeholder {
    color: var(--text-muted);
}

.hero-domain {
    color: var(--text-muted);
    font-size: 0.95rem;
    padding-right: 4px;
    white-space: nowrap;
}

/* ── Hero Visual Card ────────────────────────────────── */
.hero-visual {
    flex: 1;
    max-width: 480px;
}

.hero-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.hero-card-header {
    background: var(--navy);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hero-card-dot.red { background: #ef4444; }
.hero-card-dot.yellow { background: #f59e0b; }
.hero-card-dot.green { background: #22c55e; }

.hero-card-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin-left: 8px;
}

.hero-card-body {
    padding: 4px 0;
}

.hero-email-row {
    display: grid;
    grid-template-columns: 1fr 1.6fr auto;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.82rem;
    transition: background var(--transition);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.hero-email-row:nth-child(1) { animation-delay: 0.2s; }
.hero-email-row:nth-child(2) { animation-delay: 0.5s; }
.hero-email-row:nth-child(3) { animation-delay: 0.8s; }

.hero-email-row:last-child {
    border-bottom: none;
}

.hero-from {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-subject {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-time {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

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

/* ── Features Section (Homepage) ─────────────────────── */
.features {
    padding: 60px 0 80px;
    max-width: 1000px;
    margin: 0 auto;
}

.features h2 {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Inbox Header ────────────────────────────────────── */
.inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.inbox-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.inbox-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbox-search {
    display: flex;
    align-items: center;
}

.inbox-search input {
    border: 2px solid var(--border-color);
    padding: 8px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    outline: none;
    width: 200px;
    transition: border-color var(--transition);
}

.inbox-search input:focus {
    border-color: var(--teal);
}

/* ── Email Table ─────────────────────────────────────── */
.email-table-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.email-table {
    width: 100%;
    border-collapse: collapse;
}

.email-table thead th {
    background: var(--card-bg);
    padding: 14px 16px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.email-table .col-check {
    width: 40px;
    text-align: center;
}

.email-table .col-from {
    width: 30%;
}

.email-table .col-received {
    width: 120px;
    text-align: right;
}

.email-row {
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.email-row:hover {
    background: var(--hover-bg);
}

.email-row:last-child {
    border-bottom: none;
}

.email-row td {
    padding: 14px 16px;
    font-size: 0.9rem;
}

.email-row .col-from {
    font-weight: 500;
    color: var(--text-primary);
}

.email-row .col-subject {
    color: var(--text-secondary);
}

.email-row .col-received {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: right;
    white-space: nowrap;
}

.email-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--teal);
}

.email-table .col-actions {
    width: 50px;
    text-align: center;
}

.inline-delete-form {
    display: inline;
}

.btn-row-delete {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.email-row:hover .btn-row-delete {
    opacity: 1;
}

.btn-row-delete:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

/* ── Empty Inbox ─────────────────────────────────────── */
.empty-inbox {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-inbox p {
    font-size: 1rem;
    margin-bottom: 8px;
}

/* ── Email Detail ────────────────────────────────────── */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.breadcrumb-label {
    font-weight: 700;
    color: var(--text-primary);
}

.breadcrumb-sep {
    color: var(--text-muted);
}

.breadcrumb-subject {
    color: var(--text-secondary);
}

.detail-meta {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
}

.meta-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.meta-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    min-width: 100px;
}

.meta-value {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ── Tabs ────────────────────────────────────────────── */
.detail-tabs {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tab-list {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--blue-accent);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--blue-accent);
    border-radius: 3px 3px 0 0;
}

.tab-content {
    padding: 24px;
    min-height: 300px;
}

/* ── Tab Panes ───────────────────────────────────────── */
.email-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--radius-sm);
    background: #fff;
}

.code-block {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 20px;
    border-radius: var(--radius-sm);
    font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-block {
    color: #a6e3a1;
}

.links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.links-list li {
    padding: 8px 12px;
    background: var(--hover-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--blue-accent);
}

.extracted-link {
    font-size: 0.88rem;
    word-break: break-all;
}

.tab-pane-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-size: 0.95rem;
}

.attachments-table {
    width: 100%;
    border-collapse: collapse;
}

.attachments-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.attachments-table td {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

/* ── Footer ──────────────────────────────────────────── */
.footer {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.6);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-top: auto;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.4);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        gap: 40px;
        padding: 40px 0 60px;
    }

    .hero-visual {
        max-width: 100%;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: 24px 20px;
    }

    .inbox-header {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-meta {
        flex-direction: column;
        gap: 16px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .top-bar {
        padding: 6px 12px;
    }

    .top-search input {
        width: 180px;
    }

    .navbar {
        padding: 0 16px;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .inbox-search input {
        width: 140px;
    }

    .email-table .col-from,
    .email-table .col-received {
        display: none;
    }
}
