/* assets/css/style.css - Styles for Muslim Nonbu Token System */
@import url('https://fonts.googleapis.com/css2?family=Mukta+Malar:wght@300;400;500;600;700;800&family=Noto+Sans+Tamil:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #ccfbf1;
    --secondary: #0369a1;
    --accent: #d97706;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --success: #15803d;
    --success-light: #dcfce7;
    --warning: #b45309;
    --warning-light: #fef3c7;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --pink-token-bg: #fad7e4;
    --pink-token-border: #f2a8c5;
    --font-tamil: 'Mukta Malar', 'Noto Sans Tamil', 'Latha', 'Vijaya', sans-serif;
}

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

body {
    font-family: var(--font-tamil);
    background-color: #f8fafc;
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.navbar {
    background: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.brand-icon {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.brand-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 400;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    color: #e0f2fe;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Main Container */
.main-wrapper {
    max-width: 1300px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1rem;
    flex: 1;
}

/* Page Titles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cards & Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
}

@media (max-width: 960px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    background: #fdfdfd;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-label .required {
    color: var(--danger);
}

.form-label .badge-tip {
    font-size: 0.75rem;
    font-weight: 400;
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-control.is-invalid {
    border-color: var(--danger);
    background-color: #fff8f8;
}

.form-control.is-valid {
    border-color: var(--success);
    background-color: #f7fff9;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.3rem;
}

/* Alert Boxes */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.92rem;
}

.alert-danger {
    background-color: var(--danger-light);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-success {
    background-color: var(--success-light);
    border: 1px solid #86efac;
    color: #166534;
}

.alert-warning {
    background-color: var(--warning-light);
    border: 1px solid #fde047;
    color: #854d0e;
}

.alert-info {
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #0369a1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #166534;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* Stats Counter Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 0.2rem;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th, .table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.table tr:hover {
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* ========================================================
   EXACT TOKEN SLIP DESIGN (MATCHING DEMO PHOTO)
======================================================== */
.token-slip-container {
    background: #f1f5f9;
    padding: 1.25rem;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--gray-300);
}

.token-slip {
    background-color: var(--pink-token-bg);
    width: 100%;
    max-width: 680px;
    min-height: 250px;
    border: 1px solid var(--pink-token-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 16px 20px;
    display: flex;
    flex-direction: row;
    position: relative;
    box-sizing: border-box;
    font-family: var(--font-tamil);
    color: #000;
    user-select: text;
}

/* Left Barcode Strip */
.token-left-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-right: 18px;
    padding-right: 8px;
    gap: 8px;
}

.token-date-rotated {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #111;
    white-space: nowrap;
    text-align: center;
}

.token-barcode-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.token-barcode-vertical {
    transform: rotate(90deg);
    transform-origin: center center;
    margin: 40px -40px;
}

/* Main Content Area */
.token-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.token-header-number {
    font-size: 26px;
    font-weight: 800;
    color: #000;
    letter-spacing: 1px;
    line-height: 1;
    margin-bottom: 10px;
}

.token-details-table {
    width: 100%;
    font-size: 14.5px;
    line-height: 1.45;
    border-collapse: collapse;
}

.token-details-table td {
    padding: 1.5px 0;
    vertical-align: top;
    color: #000;
}

.token-label-cell {
    font-weight: 700;
    width: 135px;
    white-space: nowrap;
}

.token-colon-cell {
    width: 15px;
    font-weight: 700;
    text-align: center;
}

.token-value-cell {
    font-weight: 500;
}

.token-value-highlight {
    font-weight: 700;
}

/* Bottom Right Signature / Sponsor block (Framed as per new image) */
.token-sponsor-box {
    border: 1.5px solid #134e4a;
    border-radius: 8px;
    padding: 6px 12px;
    text-align: center;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.45);
    color: #134e4a;
}

.token-sponsor-family {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.2px;
}

.token-sponsor-company {
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0.3px;
    color: #0c3b38;
}

.token-sponsor-address {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.2px;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .navbar, .page-header, .btn, .card-header, 
    .form-group, .no-print, .stats-grid {
        display: none !important;
    }

    .main-wrapper {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .card-body {
        padding: 0 !important;
    }

    .token-slip-container {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .token-slip {
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 3 tokens per A4 sheet */
    .a4-print-sheet {
        display: flex;
        flex-direction: column;
        gap: 18px;
    }

    .token-slip-print {
        border: 1px dashed #777 !important;
    }
}

/* Year Switcher & Multi-Year Styles */
.year-selector-card {
    background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 100%);
    border: 2px solid #0f766e;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}

.year-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-year-pill {
    padding: 7px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    border-radius: 24px;
    border: 2px solid #0f766e;
    background: #ffffff;
    color: #0f766e;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-year-pill:hover {
    background: #ccfbf1;
    transform: translateY(-1px);
}

.btn-year-pill.active {
    background: #0f766e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

/* Previous Year Found Box */
.card-previous-year {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.12);
    animation: fadeInScale 0.25s ease;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.badge-year {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-year-2026 {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-year-2027 {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
}

.modal-dialog {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideIn 0.2s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
}

.modal-close-btn:hover {
    color: #0f172a;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    background: #f8fafc;
}

/* Footer */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    text-align: center;
    padding: 1.25rem;
    font-size: 0.85rem;
    margin-top: auto;
}
