/* Enhanced Student Management System Styles */

:root {
    --sidebar-width: 280px;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 15px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    color: #333;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: translateX(-100%);
    transition: var(--transition);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-header i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-header h5 {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 16px 25px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: var(--transition);
    border-left: 4px solid transparent;
    margin: 5px 15px;
    border-radius: 12px;
    font-weight: 500;
    gap: 12px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    transform: translateX(8px);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-menu i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    margin-left: 0;
    transition: var(--transition);
    min-height: 100vh;
}

.main-content.shifted {
    margin-left: var(--sidebar-width);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.hamburger {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.hamburger:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

/* Content Area */
.content {
    padding: 40px;
}

/* Cards and Containers */
.card, .form-card, .table-container, .search-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover, .form-card:hover, .table-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header, .form-header, .table-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 25px 30px;
    border: none;
    position: relative;
    overflow: hidden;
}

.card-header::before, .form-header::before, .table-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.card-body, .form-body {
    padding: 30px;
}

/* Buttons */
.btn {
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #e74c3c 100%);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fd7e14 100%);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #6f42c1 100%);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 15px 20px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    transform: translateY(-2px);
}

/* Tables */
.table {
    margin: 0;
}

.table th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 20px 15px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

/* Badges */
.badge {
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-class {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
    color: white;
}

.badge-section {
    background: linear-gradient(135deg, var(--info-color) 0%, #6f42c1 100%);
    color: white;
}

/* Stats Cards */
.stats-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stats-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.stats-card.students::before {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stats-card.fees::before {
    background: linear-gradient(90deg, var(--success-color), #20c997);
}

.stats-card.amount::before {
    background: linear-gradient(90deg, var(--warning-color), #fd7e14);
}

.stats-card.balance::before {
    background: linear-gradient(90deg, var(--danger-color), #e74c3c);
}

.stats-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 20px 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Charts */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 30px;
    opacity: 0.3;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(5px);
}

.overlay.show {
    display: block;
}

/* Responsive Design */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .hamburger {
        display: none;
    }
}

@media (max-width: 767px) {
    .content {
        padding: 20px;
    }
    
    .card-body, .form-body {
        padding: 20px;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icon and Button Alignment Fixes */
.btn i {
    margin-right: 8px;
    font-size: 0.9em;
    vertical-align: middle;
}

.btn-group .btn i {
    margin-right: 0;
}

.btn-sm i {
    font-size: 0.8em;
    margin-right: 6px;
}

.btn-lg i {
    font-size: 1.1em;
    margin-right: 10px;
}

/* Header button alignment */
.header .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header .btn i {
    margin-right: 0;
}

/* Table action buttons */
.table .btn-group {
    display: flex;
    gap: 5px;
}

.table .btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    min-width: 40px;
}

.table .btn-group .btn i {
    margin-right: 0;
    font-size: 0.9em;
}

/* Form buttons alignment */
.form-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Alert icon alignment */
.alert i {
    margin-right: 10px;
    font-size: 1.1em;
    vertical-align: middle;
}

/* Badge icon alignment */
.badge i {
    margin-right: 5px;
    font-size: 0.8em;
    vertical-align: middle;
}

/* Stats card icon alignment */
.stats-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* Sidebar icon alignment */
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu i {
    margin-right: 0;
    width: 20px;
    text-align: center;
}

/* Filter form alignment */
.form-row .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

/* Clear button alignment for filter forms */
.card-body .row.g-3 .col-md-1 .btn,
.card-body .row .col-md-1 .btn {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 12px 8px;
    min-width: 60px;
    text-decoration: none;
    border: 1px solid #6c757d;
    background-color: #6c757d;
    color: white;
    transition: all 0.3s ease;
}

.card-body .row.g-3 .col-md-1 .btn:hover,
.card-body .row .col-md-1 .btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
    text-decoration: none;
}

/* Additional styling for clear buttons to ensure visibility */
.card-body .row .col-md-1 .d-grid .btn,
.card-body .row.g-3 .col-md-1 .d-grid .btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 12px 8px;
    min-width: 60px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Specific styling for clear button (secondary) */
.card-body .row .col-md-1 .d-grid .btn.btn-secondary,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-secondary {
    border: 1px solid #6c757d;
    background-color: #6c757d;
    color: white;
}

.card-body .row .col-md-1 .d-grid .btn.btn-secondary:hover,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
    text-decoration: none;
}

/* Specific styling for filter button (primary) */
.card-body .row .col-md-1 .d-grid .btn.btn-primary,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-primary {
    border: 1px solid #0d6efd;
    background-color: #0d6efd;
    color: white;
}

.card-body .row .col-md-1 .d-grid .btn.btn-primary:hover,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: white;
    text-decoration: none;
}

/* Download button alignment */
.d-flex.justify-content-between .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Responsive button alignment */
@media (max-width: 767px) {
    .btn i {
        margin-right: 6px;
    }
    
    .btn-sm i {
        margin-right: 4px;
    }
    
    .table .btn-group .btn {
        padding: 6px 10px;
        min-width: 35px;
    }
    
    .header .btn {
        padding: 8px 12px;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* Button container alignment for students page */
.search-card .card-body .row .col-md-2 > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

/* Comprehensive fix for all filter forms across pages */
.card-body .row .col-md-1 .d-grid .btn,
.card-body .row.g-3 .col-md-1 .d-grid .btn,
.card-body .row .col-md-2 .d-grid .btn,
.card-body .row.g-3 .col-md-2 .d-grid .btn {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 12px 8px;
    min-width: 60px;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Specific styling for clear button (secondary) */
.card-body .row .col-md-1 .d-grid .btn.btn-secondary,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-secondary,
.card-body .row .col-md-2 .d-grid .btn.btn-secondary,
.card-body .row.g-3 .col-md-2 .d-grid .btn.btn-secondary {
    border: 1px solid #6c757d;
    background-color: #6c757d;
    color: white;
}

.card-body .row .col-md-1 .d-grid .btn.btn-secondary:hover,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-secondary:hover,
.card-body .row .col-md-2 .d-grid .btn.btn-secondary:hover,
.card-body .row.g-3 .col-md-2 .d-grid .btn.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
    text-decoration: none;
}

/* Specific styling for filter button (primary) */
.card-body .row .col-md-1 .d-grid .btn.btn-primary,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-primary,
.card-body .row .col-md-2 .d-grid .btn.btn-primary,
.card-body .row.g-3 .col-md-2 .d-grid .btn.btn-primary {
    border: 1px solid #0d6efd;
    background-color: #0d6efd;
    color: white;
}

.card-body .row .col-md-1 .d-grid .btn.btn-primary:hover,
.card-body .row.g-3 .col-md-1 .d-grid .btn.btn-primary:hover,
.card-body .row .col-md-2 .d-grid .btn.btn-primary:hover,
.card-body .row.g-3 .col-md-2 .d-grid .btn.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    color: white;
    text-decoration: none;
}
