/* ══════════════════════════════════════════
   MailCheck Tools — Premium Dark Design v3
   ══════════════════════════════════════════ */
:root {
    --bg: #07070e;
    --bg-card: #0e0e1a;
    --bg-elevated: #131328;
    --bg-glass: rgba(19, 19, 40, 0.6);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text: #e8e8ed;
    --text-dim: #7b7b8f;
    --text-muted: #4d4d5e;
    --accent: #7c4dff;
    --accent-light: #b388ff;
    --accent-glow: rgba(124, 77, 255, 0.3);
    --green: #00e676;
    --green-bg: rgba(0, 230, 118, 0.1);
    --orange: #ff9100;
    --orange-bg: rgba(255, 145, 0, 0.1);
    --red: #ff1744;
    --red-bg: rgba(255, 23, 68, 0.1);
    --gradient-1: linear-gradient(135deg, #7c4dff 0%, #536dfe 100%);
    --gradient-2: linear-gradient(135deg, #00e676 0%, #00c853 100%);
    --gradient-3: linear-gradient(135deg, #ff9100 0%, #ff6d00 100%);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════ NAVIGATION ═══════════ */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-brand { flex-shrink: 0; }

.nav-brand a {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand .logo-icon {
    width: 28px; height: 28px;
    background: var(--gradient-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    overflow-x: auto;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

.nav-links a.active {
    color: var(--accent-light);
    background: rgba(124, 77, 255, 0.1);
}

.nav-links .nav-cta {
    background: var(--gradient-1);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    margin-left: 0.25rem;
}

.nav-links .nav-cta:hover {
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-1px);
    background: var(--gradient-1);
    color: #fff;
}

/* Mobile nav hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ═══════════ MAIN ═══════════ */
main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* ═══════════ HERO ═══════════ */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-dim) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

.hero form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
}

.hero input[type="text"],
.hero input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition);
}

.hero input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.hero button,
button[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: var(--gradient-1);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.hero button:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

button:active { transform: translateY(0) !important; }

.hero select {
    padding: 0.75rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}

/* ═══════════ TOOL GRID ═══════════ */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-top: 2rem;
}

.tool-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.tool-grid a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity var(--transition);
}

.tool-grid a:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tool-grid a:hover::before { opacity: 0.03; }

.tool-grid .tool-icon { font-size: 1.5rem; }

.tool-grid .tool-name {
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* ═══════════ RESULTS ═══════════ */
.results { margin-top: 2rem; }

.score-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.score-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.score-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.result-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.result-item:hover { border-color: var(--border-hover); }

.result-item strong { display: block; margin-bottom: 0.3rem; }

/* ═══════════ CARDS ═══════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

/* ═══════════ CONTENT ═══════════ */
.guide, section[style*="max-width"] {
    max-width: 800px;
    margin: 2rem auto;
    line-height: 1.75;
}

.guide h2, section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.02em;
}

.guide h3, section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.guide p, section p { color: var(--text-dim); margin-bottom: 0.75rem; }

.guide ul, .guide ol,
section ul, section ol { padding-left: 1.5rem; margin-bottom: 1rem; color: var(--text-dim); }

.guide li, section li { margin-bottom: 0.3rem; }

.guide code {
    background: var(--bg-elevated);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
    border: 1px solid var(--border);
}

pre {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0.75rem 0;
}

pre code {
    background: none;
    border: none;
    padding: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

tr:hover td { background: rgba(255,255,255,0.01); }

/* ═══════════ ALERTS ═══════════ */
.warning {
    background: var(--orange-bg);
    border: 1px solid var(--orange);
    color: var(--orange);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* ═══════════ LINKS ═══════════ */
a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* ═══════════ BUTTON OUTLINE ═══════════ */
.button-outline {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.button-outline:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ═══════════ TOC ═══════════ */
.toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.toc h3 { margin-top: 0; }

.toc ol { color: var(--text-dim); }

.toc a { color: var(--text-dim); }

.toc a:hover { color: var(--text); }

/* ═══════════ FAQ ═══════════ */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--bg-card);
    transition: background var(--transition);
}

.faq-item summary:hover { background: var(--bg-elevated); }

.faq-item p { padding: 0 1.25rem 1rem; color: var(--text-dim); }

/* ═══════════ FOOTER ═══════════ */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    background: var(--bg-card);
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color var(--transition);
}

footer a:hover { color: var(--text); }

/* ═══════════ PULSE ANIMATION ═══════════ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.status-dot.green { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }

.status-dot.red { background: var(--red); }

.status-dot.orange { background: var(--orange); }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
    nav {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links a { font-size: 0.8rem; padding: 0.3rem 0.5rem; }

    main { padding: 1.5rem 1rem 2rem; }

    .hero { padding: 1rem 0; }

    .hero h1 { font-size: 1.6rem; }

    .hero .subtitle { font-size: 1rem; }

    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }

    .result-grid { grid-template-columns: 1fr; }

    .score-value { font-size: 2rem; }
}

@media (max-width: 480px) {
    .hero form { flex-direction: column; }

    .hero button { width: 100%; }

    .tool-grid a { padding: 1rem 0.5rem; }
}

/* ═══════════ UTILITY ═══════════ */
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.gap-1 { gap: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { justify-content: center; }

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════ SELECTION ═══════════ */
::selection {
    background: rgba(124, 77, 255, 0.3);
    color: var(--text);
}

/* ═══════════ NAV DROPDOWN ═══════════ */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-toggle {
    cursor: pointer;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
    z-index: 1000;
    padding: 0.5rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.nav-dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}
.dropdown-menu a:hover {
    background: var(--bg-elevated);
    color: var(--text);
}
.dropdown-menu a.active {
    color: var(--purple-light);
    font-weight: 600;
}
