/**
 * Visitor Management System - Stylesheet
 * Firayalal Public School
 * Navy Blue + Gold/Yellow Theme
 * Fonts: Lexend, Jost
 * Mobile-First Design
 */

@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700&family=Lexend:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
    --primary-navy: #1a365d;
    --primary-navy-dark: #0f2744;
    --primary-navy-light: #2c5282;
    --accent-gold: #d4af37;
    --accent-gold-light: #e8c547;
    --accent-gold-dark: #b8960c;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --light-gray: #e9ecef;
    --medium-gray: #adb5bd;
    --dark-gray: #495057;
    --text-dark: #212529;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s ease;
    --font-heading: 'Lexend', sans-serif;
    --font-body: 'Jost', sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Header Styles */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--light-gray);
    padding: 0.75rem 1rem;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-section {
    line-height: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.module-title {
    background: var(--primary-navy);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.module-title i {
    color: var(--accent-gold);
}

/* Footer Styles */
.footer {
    background: var(--primary-navy-dark);
    color: var(--white);
    padding: 1rem 0;
    text-align: center;
    margin-top: auto;
}

.footer p {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Main Container */
.main-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 140px);
}

@media (min-width: 768px) {
    .main-container {
        max-width: 720px;
        padding: 1.5rem;
    }
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    background: var(--primary-navy);
    color: var(--white);
    padding: 1rem 1.25rem;
    border-bottom: 3px solid var(--accent-gold);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
}

.card-header h2 i {
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-header {
        padding: 1.25rem 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
}

/* Form Styles */
.form-section {
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-section-title i {
    font-size: 0.8rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
    font-size: 0.8rem;
    font-family: var(--font-heading);
}

.form-group label .required {
    color: var(--danger);
    margin-left: 0.15rem;
}

.form-group label .optional {
    color: var(--medium-gray);
    font-size: 0.7rem;
    font-weight: 400;
    margin-left: 0.15rem;
}

.form-control {
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--light-gray);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    font-family: var(--font-body);
    height: 40px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15);
}

.form-control::placeholder {
    color: var(--medium-gray);
    font-size: 0.85rem;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    height: auto;
}

@media (min-width: 768px) {
    .form-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .form-group.full-width {
        grid-column: 1 / -1;
    }
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--primary-navy-dark);
}

.btn-primary:hover {
    background: var(--accent-gold-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--light-gray);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--medium-gray);
    color: var(--white);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.btn-group {
    display: flex;
    gap: 0.625rem;
    justify-content: center;
    margin-top: 1.25rem;
}

@media (min-width: 768px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* Alert Styles */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: #fefcbf;
    color: #744210;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: #bee3f8;
    color: #2a4365;
    border-left: 4px solid var(--info);
}

/* Gate Pass Styles - Compact Professional Design */
.gate-pass-container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--white);
    border: 1px solid var(--primary-navy);
    border-radius: 10px;
    overflow: hidden;
}

.gate-pass-header {
    background: var(--primary-navy);
    color: var(--white);
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--accent-gold);
}

.gate-pass-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    background: var(--white);
    border-radius: 10px;
    padding: 4px;
}

.gate-pass-header .pass-title {
    color: var(--white);
    font-weight: 600;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.gate-pass-body {
    padding: 1rem;
}

.info-section {
    margin-bottom: 0.5rem;
}

.info-section:last-of-type {
    margin-bottom: 0;
}

.info-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    width: 60px;
    font-weight: 500;
    color: var(--dark-gray);
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    margin-right: 0.5rem;
}

.info-value {
    flex: 1;
    color: var(--text-dark);
    font-weight: 400;
}

@media (min-width: 768px) {
    .gate-pass-container {
        max-width: 360px;
    }
    
    .gate-pass-header {
        padding: 0.875rem 1.25rem;
    }
    
    .gate-pass-logo {
        height: 40px;
    }
    
    .gate-pass-body {
        padding: 1rem;
    }
}

/* Admin Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    border-top: 4px solid var(--accent-gold);
}

.stat-card.visitors-today {
    border-top-color: var(--info);
}

.stat-card.visitors-inside {
    border-top-color: var(--success);
}

.stat-card.visitors-exited {
    border-top-color: var(--danger);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--dark-gray);
    font-weight: 500;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--primary-navy);
    color: var(--white);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table th:first-child {
    border-radius: var(--border-radius) 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 var(--border-radius) 0 0;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.data-table tr:hover {
    background: var(--light-bg);
}

.data-table tr:last-child td:first-child {
    border-radius: 0 0 0 var(--border-radius);
}

.data-table tr:last-child td:last-child {
    border-radius: 0 0 var(--border-radius) 0;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-inside {
    background: #c6f6d5;
    color: #22543d;
}

.badge-exited {
    background: #fed7d7;
    color: #742a2a;
}

/* Search & Filter Styles */
.filter-section {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
}

.filter-group .form-control {
    padding: 0.75rem 1rem;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-navy-dark) 100%);
    padding: 2rem;
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.login-header {
    background: var(--accent-gold);
    padding: 2rem;
    text-align: center;
}

.login-header h2 {
    color: var(--primary-navy-dark);
    font-size: 1.5rem;
    font-weight: 700;
}

.login-body {
    padding: 2rem;
}

/* Print Styles - Match Screen Exactly */
@media print {
    @page {
        size: 100mm 140mm;
        margin: 0;
    }
    
    * {
        box-sizing: border-box;
    }
    
    html, body {
        background: white;
        margin: 0;
        padding: 0;
    }
    
    .header,
    .footer,
    .btn-group,
    .no-print {
        display: none !important;
    }
    
    .main-container {
        padding: 0;
        margin: 0;
        min-height: auto;
        width: 100mm;
    }
    
    .gate-pass-container {
        border: 1px solid var(--primary-navy);
        box-shadow: none;
        width: 100mm;
        margin: 0;
        border-radius: 10px;
        overflow: hidden;
        background: white;
    }
    
    .gate-pass-header {
        background: var(--primary-navy) !important;
        color: white !important;
        padding: 1rem;
        border-bottom: 2px solid var(--accent-gold);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .gate-pass-logo {
        height: 40px;
        background: white !important;
        border-radius: 10px;
        padding: 4px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .gate-pass-header .pass-title {
        color: white !important;
        font-size: 14px;
        font-weight: 600;
        font-family: var(--font-heading);
        letter-spacing: 1px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .gate-pass-body {
        padding: 1rem;
    }
    
    .info-section {
        margin-bottom: 0.75rem;
    }
    
    .info-row {
        display: flex;
        flex-direction: row;
        align-items: baseline;
        font-size: 13px;
        margin-bottom: 6px;
        line-height: 1.4;
    }
    
    .info-label {
        width: 60px;
        font-size: 12px;
        font-weight: 500;
        color: var(--dark-gray);
        flex-shrink: 0;
        font-family: var(--font-heading);
        margin-right: 8px;
    }
    
    .info-value {
        flex: 1;
        color: var(--text-dark);
        font-size: 13px;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .school-info h1 {
        font-size: 1.25rem;
    }
    
    .module-title {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .signature-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .info-row {
        flex-direction: column;
    }
    
    .info-label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .photo-placeholder {
        margin: 1rem auto 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
