/* ============================================================
   mail.css — Styles for /mail/ listing and /mail/slug pages
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --accent: #d32f2f;
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Override nav.php's transparent glass nav for this light-bg page ── */
.navbar {
    background: linear-gradient(135deg, #1e3a8a, #1e40af) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 2px 12px rgba(30,58,138,0.3) !important;
}
.navbar .nav-brand,
.navbar .nav-link,
.navbar span {
    color: white !important;
}
.navbar .nav-logo {
    border-color: rgba(255,255,255,0.3) !important;
}

/* Navbar handled by nav.php include */

/* ── HERO (listing page) ── */
.hero {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: white;
    text-align: center;
    padding: 48px 20px 40px;
}

.hero-title {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.hero-sub {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 14px;
    opacity: 0.85;
    max-width: 520px;
    margin: auto;
}

.hero-highlight {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 18px 24px;
    margin-top: 20px;
    font-weight: 600;
    line-height: 1.7;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    opacity: 1 !important;
}

/* ── LISTING CARDS ── */
.container {
    max-width: 720px;
    margin: auto;
    padding: 32px 20px 60px;
}

/* template page container — narrower */
.container.template-page {
    max-width: 640px;
    padding: 0 20px;
}

.section-label {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.template-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-left: 5px solid var(--primary);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.18s, box-shadow 0.18s;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.13);
}

.card-inner {
    padding: 17px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-subject {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-counter {
    background: #eef2ff;
    border-radius: 20px;
    padding: 5px 13px;
    text-align: center;
    min-width: 72px;
}

.counter-num {
    font-size: 17px;
    font-weight: 800;
    color: #4f46e5;
    display: block;
    line-height: 1.1;
}

.counter-lbl {
    font-size: 10px;
    color: var(--muted);
}

.arrow {
    color: #cbd5e1;
    font-size: 18px;
}

/* ── EMPTY STATE ── */
.empty {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Noto Sans Tamil', sans-serif;
    color: var(--muted);
}

.empty span {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

/* ── TEMPLATE PAGE: counter ── */
.counter-box {
    text-align: center;
    padding: 20px;
    margin: 24px auto 0;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 14px;
    max-width: 600px;
}

.counter-number {
    font-size: 36px;
    font-weight: 800;
    color: #4f46e5;
}

.counter-text {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
    font-family: 'Noto Sans Tamil', sans-serif;
}

/* ── TEMPLATE PAGE: form card ── */
.card {
    background: var(--card);
    padding: 28px;
    margin: 20px auto 0;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.title {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #1e3a8a;
    background: #eff6ff;
    padding: 14px 18px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    line-height: 1.5;
}

.subtitle {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.label-group {
    margin-bottom: 16px;
}

.label-group label {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

input,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[readonly],
textarea[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: not-allowed;
    border-color: #cbd5e1;
}

.send-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
    font-family: 'Noto Sans Tamil', sans-serif;
    margin-top: 4px;
}

.send-btn:hover {
    transform: translateY(-2px);
}

.send-btn:active {
    transform: translateY(0);
}

.note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
    line-height: 1.6;
    font-family: 'Noto Sans Tamil', sans-serif;
    background: #fffbeb;
    border-radius: 10px;
    padding: 12px;
}

/* ── FOOTER (Replaced by global .site-footer from footer.php) ── */

/* ── SENDER SECTION ── */
.sender-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.sender-section-title {
    font-family: 'Noto Sans Tamil', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.label-group input:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .hero-title {
        font-size: 20px;
    }

    .hero-sub {
        font-size: 13px;
    }

    .card {
        padding: 20px 16px;
    }

    .counter-number {
        font-size: 28px;
    }

    .title {
        font-size: 15px;
    }
}

/* ── REAL-TIME VALIDATION ── */
.is-valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.label-group input:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}