/* Navigation */
.main-nav {
    background: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.4rem;
    font-weight: 600;
    text-decoration: none;
}

.nav-brand i {
    font-size: 1.6rem;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

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

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

.nav-link i {
    font-size: 1rem;
}

/* Adjust container padding to account for fixed nav */
.container {
    padding-top: 30px;
}

/* Base Styles */
:root {
    --primary-color: #1a237e;
    --primary-light: #534bae;
    --primary-dark: #000051;
    --secondary-color: #ffab00;
    --text-light: #f5f5f5;
    --text-dark: #212121;
    --bg-color: #0a192f;
    --card-bg: #112240;
    --success-color: #4caf50;
    --error-color: #f44336;
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(26, 35, 126, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 171, 0, 0.1) 0%, transparent 20%);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: slideDown 0.5s ease-out;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.card-header {
    background: rgba(255, 171, 0, 0.1);
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h2 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e2e8f0;
}

.required {
    color: #f87171;
    margin-left: 3px;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(255, 171, 0, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Style for dropdown options */
select option {
    background-color: #1a1a2e;
    color: #e2e8f0;
    padding: 10px 15px;
    border: none;
}

/* Style for dropdown when opened */
select:focus option:checked {
    background: var(--secondary-color);
    color: #1a1a1a;
}

/* Fee Balances Table */
#feeBalancesTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#feeBalancesTable th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

#feeBalancesTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

#feeBalancesTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status indicators */
#feeBalancesTable td.paid {
    color: #28a745;
    font-weight: 500;
}

#feeBalancesTable td.unpaid {
    color: #dc3545;
    font-weight: 500;
}

#feeBalancesTable td.not-assigned {
    color: #6c757d;
    font-style: italic;
}

/* Search box */
.search-box {
    max-width: 300px;
    margin-bottom: 1rem;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
    scroll-behavior: smooth;
}

/* Student Fee Details Modal */
#studentFeeModal .modal-xl {
    max-width: 95%;
}

#studentFeeModal .modal-body {
    padding: 1.5rem;
}

#studentFeeModal .table {
    margin-bottom: 1.5rem;
}

#studentFeeModal .table th {
    white-space: nowrap;
    background-color: #f8f9fa;
}

#studentFeeModal .table td, 
#studentFeeModal .table th {
    vertical-align: middle;
    padding: 0.75rem;
}

#studentFeeModal .table-sm td, 
#studentFeeModal .table-sm th {
    padding: 0.3rem 0.5rem;
}

#studentFeeModal .badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

#studentFeeModal .bg-success {
    background-color: #198754 !important;
}

#studentFeeModal .bg-danger {
    background-color: #dc3545 !important;
}

#studentFeeModal .bg-warning {
    background-color: #ffc107 !important;
    color: #000;
}

#studentFeeModal .bg-secondary {
    background-color: #6c757d !important;
}

#studentFeeModal .table-active {
    background-color: rgba(0, 0, 0, 0.05);
}

#studentFeeModal .text-nowrap {
    white-space: nowrap;
}

#studentFeeModal .paid {
    color: #198754;
    font-weight: 500;
}

#studentFeeModal .unpaid {
    color: #dc3545;
    font-weight: 500;
}

#studentFeeModal .not-assigned {
    color: #6c757d;
    font-style: italic;
}

/* Print styles for the modal */
@media print {
    body * {
        visibility: hidden;
    }
    #studentFeeModal,
    #studentFeeModal * {
        visibility: visible;
    }
    #studentFeeModal {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 15px;
        width: 100%;
    }
    #studentFeeModal .modal-dialog {
        max-width: 100%;
        width: 100%;
    }
    #studentFeeModal .modal-header {
        display: none;
    }
    #studentFeeModal .btn-print,
    #studentFeeModal .btn-close {
        display: none;
    }
    @page {
        size: auto;
        margin: 0mm;
    }
    body {
        margin: 1.6cm;
    }
}

/* Parent Portal Styles */
.parent-avatar {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.summary-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.summary-card.balance-card {
    border-left-color: var(--secondary);
}

.summary-card.next-payment-card {
    border-left-color: var(--warning);
}

/* Filter term styles */
.filter-term-container {
    display: flex;
    align-items: center;
}

.filter-term-label {
    margin-bottom: 0;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.filter-term-select {
    width: auto;
}

/* Hover effect for dropdown options */
select option:hover {
    background-color: var(--secondary-color) !important;
    color: #1a1a1a;
}

/* Style for the class dropdown specifically */
#className {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

#className option {
    background-color: #1a1a2e;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#className option:hover {
    background-color: var(--secondary-color) !important;
    color: #1a1a1a;
    transform: translateX(5px);
}

textarea {
    min-height: 80px;
    resize: vertical;
}

/* Button Styles */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1rem;
}

.btn-primary {
    background: var(--secondary-color);
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 171, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.btn .btn-loading {
    display: none;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn.loading .btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(26, 35, 126, 0.95);
    color: white;
    padding: 0;
    border-radius: var(--border-radius);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    overflow: hidden;
    max-width: 500px;
    width: 90%;
    text-align: left;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast i {
    font-size: 1.4rem;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

/* Success Message Styles */
.success-message {
    padding: 0;
    width: 100%;
}

.success-icon {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon i {
    font-size: 2.5rem;
    color: #2ecc71;
}

.success-content {
    padding: 20px;
}

.success-content h3 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 1.4rem;
}

.success-content p {
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.student-details {
    background: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
}

.student-details p {
    margin: 5px 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.student-details strong {
    color: #fff;
    font-weight: 500;
    display: inline-block;
    min-width: 140px;
}

.toast.success {
    background: rgba(26, 35, 126, 0.95);
    border-top: 4px solid #2ecc71;
}

.toast.error {
    background: rgba(231, 76, 60, 0.95);
    border-top: 4px solid #c0392b;
}

@keyframes bounceIn {
    0% {
        transform: translateX(-50%) translateY(100px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) translateY(-10px) scale(1.05);
    }
    70% {
        transform: translateX(-50%) translateY(5px) scale(0.98);
    }
    100% {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 171, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 171, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 171, 0, 0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Input Validation */
input:invalid,
select:invalid,
textarea:invalid {
    border-color: #f87171;
}

input:focus:invalid,
select:focus:invalid,
textarea:focus:invalid {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
