/* ========================================
   Shree Chaitanya Holy Child School - Fees Portal
   Modern, Clean & Responsive Design
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

body {
    background: #f8fafc;
    color: #2d3748;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.4rem;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
    border: 3px solid white;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: #fde047;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Main Layout */
.main-content {
    min-height: 80vh;
    padding: 30px 20px;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
}

/* Cards & Grid */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-8px);
}

.card h3 {
    color: #1e40af;
    margin-bottom: 10px;
}

.welcome-card {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.welcome-card h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary { background: #3b82f6; color: white; }
.btn-success { background: #10b981; color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-secondary { background: #6b7280; color: white; }

.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

/* Forms */
.form-control {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
}

.form-group { margin: 15px 0; }

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.table th {
    background: #1e40af;
    color: white;
    padding: 15px;
   /* text-align: left;*/
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
}


.table tr:hover {
    background: #e8e9eb;
}

/* Landing Page */
.landing {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.6)), url('../images/hero-bg.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.landing h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.landing .tagline {
    font-size: 1.6rem;
    margin: 20px 0;
    opacity: 0.9;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    /*margin-left: 150px;*/
}

.footer i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
    .landing h1 { font-size: 3rem; }
}

@media (max-width: 768px) {
    .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
    .nav-links a span { display: none; } /* Add mobile menu later */
    .landing h1 { font-size: 2.5rem; }
    .btn { padding: 12px 20px; font-size: 0.95rem; }
}

.admin-wrapper { display: flex; min-height: calc(100vh - 70px); margin-top: 70px; }
.sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0px;
    overflow-y: auto;
    transition: width 0.3s;
}
.sidebar-logo {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #334155;
}

.unread-notifi {
    background: #e9535e none repeat scroll 0 0;
    border-radius: 12px;
    color: #ffffff;
    float: right;
    padding: 1px 8px 3px;
}
.unread-notification {
    background-color: #e18700;
    border-color: #ffffff;
    border-radius: 50%;
    color: #ffffff;
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    height: 15px;
    line-height: 14px;
    margin-left: -10px;
    position: absolute;
    text-align: center;
    width: 15px;
}

.sidebar-logo a { display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; }
.sidebar-logo img { width: 50px; height: 50px; border-radius: 50%; border: 3px solid #fbbf24; margin-right: 10px; }
.sidebar-logo span { font-size: 1.6rem; font-weight: 700; color: #fbbf24; }
.sidebar-nav a {
    display: flex; align-items: center; padding: 15px 25px; color: #cbd5e1; text-decoration: none; transition: 0.3s;
}
.sidebar-nav a i { width: 25px; font-size: 1.2rem; }
.sidebar-nav a span { margin-left: 15px; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #334155; color: white; }
.main-content { margin-left: 120px; flex: 1; background: #f8fafc; padding: 0px 30px; }
.main-content .container { max-width: 1300px; margin: 0 auto; }



/* Responsive */
@media (max-width: 992px) {
    .sidebar { width: 80px; }
    .sidebar-logo span, .sidebar-nav a span { display: none; }
    .sidebar-nav a { justify-content: center; padding: 20px 0; }
    .main-content { margin-left: 40px; }
}

@media (max-width: 768px) {
    .sidebar { width: 80px; }
    .sidebar-logo span, .sidebar-nav a span { display: none; }
    .sidebar-nav a { justify-content: center; padding: 20px 0; }
    .main-content { margin-left: 40px; }
}

/*@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; top: 0; }
    .sidebar-logo span, .sidebar-nav a span { display: inline; }
    .sidebar-nav a { justify-content: flex-start; padding: 12px 20px; }
    .main-content { margin-left: 0; }
}*/

/* ==================== MODAL STYLES ==================== */
body.modal-open {
    overflow: hidden;
    padding-right: 17px; /* Compensate for scrollbar on Windows */
}
@supports (scrollbar-width: none) or (-webkit-overflow-scrolling: touch) {
    body.modal-open {
        padding-right: 0;
    }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    background: none;
    border: none;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover { color: #000; }

.student-header { text-align: center; padding: 20px; border-bottom: 1px solid #eee; }
.student-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #ddd; }
.student-details-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.student-details-grid div { padding: 8px 0; word-break: break-word; }
.modal-actions { text-align: center; padding: 0 20px 30px; }

@media (max-width: 768px) {
    .student-details-grid { grid-template-columns: 1fr; }
    .modal-content { width: 95%; }
}


/* ========================================
   Registration Form Specific Styles
   (Namespaced to .registration-page)
   ======================================== */

.registration-page .form-container {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.registration-page h2 {
    color: #1e40af;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.registration-page .subtitle {
    color: #64748b;
    margin-bottom: 35px;
}

/* Photo Upload Box */
.registration-page .upload-box {
    border: 2px dashed #cbd5e1;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.registration-page .upload-box:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.registration-page #output-image {
    max-width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin-top: 15px;
}

/* Input Overrides for Registration only */
.registration-page .sub-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 5px;
    display: block;
    font-weight: 400;
}

.registration-page .margin-bottom {
    margin-bottom: 15px;
}

/* Address 2 Toggle Section */
.registration-page .checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border: 1px solid #e2e8f0;
    width: fit-content;
    cursor: pointer;
    background: #ffffff;
    border-radius: 10px;
    margin: 20px 0;
    transition: 0.2s;
}

.registration-page .checkbox-container:hover {
    border-color: #3b82f6;
    background: #f1f5f9;
}

.registration-page .checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Hidden Section Styling */
.registration-page #address2-section {
    display: none; /* Controlled by JS */
    background: #f1f5f9;
    padding: 25px;
    border-radius: 12px;
    border-left: 6px solid #3b82f6;
    margin-bottom: 25px;
}

/* Form Layout Helpers */
.registration-page .row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    
}

.registration-page .col {
    flex: 1;
}

/* Responsive Fix for Registration Page */
@media (max-width: 768px) {
    .registration-page .row {
        flex-direction: column;
        gap: 10px;
    }
    .registration-page .form-container {
        padding: 20px;
        margin: 10px;
    }

    
        /* Specific Invoice Styles to complement existing style.css */
        .invoice-box {
            background: #fff;
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
            max-width: 900px;
            margin: 20px auto;
        }
        .invoice-header {
            text-align: center;
            margin-bottom: 30px;
        }
        .invoice-header h2 {
            font-size: 2rem;
            color: #1e40af;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        .invoice-meta {
            display: flex;
            justify-content: space-between;
            margin-bottom: 20px;
            font-weight: 500;
        }
        .student-info-table th {
            background: #f1f5f9 !important;
            color: #1e293b !important;
            border: 1px solid #e2e8f0;
        }
        .student-info-table td {
            border: 1px solid #e2e8f0;
        }
        .billing-table th {
            text-align: left;
        }
        .billing-table td {
            text-align: left;
        }
        .billing-table .amount-col {
            text-align: right;
        }
        .total-row {
            font-weight: bold;
            background-color: #f8fafc;
        }
        .payment-info {
            margin-top: 30px;
            padding: 20px;
            background: #f1f5f9;
            border-radius: 8px;
        }
        .payment-info h4 {
            margin-bottom: 10px;
            color: #1e40af;
        }
        .no-print-btn {
            margin-bottom: 20px;
            text-align: right;
        }
        
        @media print {
            .navbar, .sidebar, .no-print-btn, .footer {
                display: none !important;
            }
            .main-content {
                margin-left: 0 !important;
                padding: 0 !important;
            }
            .invoice-box {
                box-shadow: none;
                border: none;
                width: 100%;
            }
        }
    
/* ========================================
   Main Content Sub - Dashboard Layout
   ======================================== */

.admin-wrapper {
    display: flex;
    margin-top: 0; /* Adjusted because sidebar is fixed top: 70px */
}

.main-content-sub {
    flex: 1;
    margin-left: 260px; /* Matches sidebar width */
    padding: 40px;
    background: #f8fafc;
    min-height: calc(100vh - 70px); /* Full height minus navbar */
    transition: all 0.3s ease;
}

/* Container inside the sub-content for consistent width */
.main-content-sub .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page Header styling for inside main-content-sub */
.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h2 {
    font-size: 1.8rem;
    color: #1e293b;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-content-sub {
        margin-left: 80px; /* Matches collapsed sidebar width */
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .main-content-sub {
        margin-left: 80px; 
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}


}