/* styles.css */
:root {
    --primary-color: #2A3F54;
    --secondary-color: #3498DB;
    --accent-color: #1ABC9C;
    --danger-color: #E74C3C;
    --success-color: #27AE60;
    --warning-color: #F39C12;
    --light-bg: #F8F9FA;
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

* {
    font-family: 'Cairo', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-top: 80px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') repeat-x bottom;
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

/* ===== Navbar Styles ===== */
.navbar {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand-custom {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.navbar-brand-custom:hover {
    transform: translateY(-2px);
}

.school-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

.school-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.school-name-ar {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.school-name-en {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--secondary-color);
    letter-spacing: 0.5px;
}

.nav-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.nav-icon-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: white;
}

.nav-icon-btn i {
    font-size: 1.2rem;
}

/* ===== Login Overlay ===== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 25px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.5s ease;
}

.login-box h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-weight: 700;
}

.login-box .form-control {
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.login-box .form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.login-box .btn-primary {
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.teacher-info-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ===== Statistics Cards ===== */
.stats-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.stats-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--card-shadow-hover);
}

.stats-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.stats-card-absent .stats-card-icon {
    background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
    color: white;
}

.stats-card-violations .stats-card-icon {
    background: linear-gradient(135deg, #F39C12, #E67E22);
    color: white;
}

.stats-card-attendance .stats-card-icon {
    background: linear-gradient(135deg, #27AE60, #229954);
    color: white;
}

.stats-card h5 {
    font-size: 0.95rem;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 0;
}

.stats-card small {
    color: #95a5a6;
    font-size: 0.85rem;
}

/* ===== Main Cards ===== */
.main-card {
    background: white;
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    animation: fadeInUp 0.7s ease;
}

.main-card h4 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-card h4 i {
    color: var(--secondary-color);
}

/* ===== Form Controls ===== */
.form-control-custom {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 20px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control-custom:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.15);
    background: white;
}

.form-control-custom:hover {
    border-color: var(--secondary-color);
    background: white;
}

/* ===== Buttons ===== */
.btn-custom-primary {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border: none;
    color: white;
    padding: 14px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-custom-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.4);
    color: white;
}

.btn-custom-success {
    background: linear-gradient(135deg, var(--success-color), #229954);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-custom-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    color: white;
}

/* ===== Students Panel ===== */
.students-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 2rem;
}

.student-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.student-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

.student-btn:hover::before {
    left: 100%;
}

.student-btn:hover {
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.2);
}

.student-btn.absence {
    background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
    color: white;
    border-color: #FF6B6B;
}

.student-btn.no-absence {
    background: white;
    color: #2c3e50;
}

/* ===== Table Styles ===== */
.table-responsive {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color), #1a2a3b);
}

.table thead th {
    padding: 1.2rem;
    font-weight: 600;
    border: none;
    color: white;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #f1f3f5;
}

.btn-danger-custom {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-danger-custom:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* ===== Settings Panel ===== */
#settingsPanel {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: visibility 0s 0.3s, opacity 0.3s ease;
}

#settingsPanel.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.settings-content {
    background: white;
    border-radius: 25px;
    padding: 2.5rem;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: zoomIn 0.3s ease;
}

.settings-content h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.settings-content .btn {
    width: 100%;
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.settings-content .btn:hover {
    transform: translateX(-5px);
}

.btn-close-settings {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
    border: none;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        padding: 0.75rem 0;
    }
    
    .school-logo {
        width: 40px;
        height: 40px;
    }
    
    .school-name-ar {
        font-size: 1rem;
    }
    
    .school-name-en {
        font-size: 0.65rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .stats-card {
        padding: 1.5rem;
    }
    
    .stats-card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .stats-card h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 65px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .navbar-brand-custom {
        gap: 10px;
    }
    
    .school-logo {
        width: 35px;
        height: 35px;
    }
    
    .school-name-ar {
        font-size: 0.9rem;
    }
    
    .school-name-en {
        font-size: 0.6rem;
    }
    
    .nav-icon-btn {
        width: 40px;
        height: 40px;
    }
    
    .nav-icon-btn i {
        font-size: 1rem;
    }
    
    .page-header {
        margin-bottom: 2rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    .teacher-info-badge {
        font-size: 0.85rem;
        padding: 8px 20px;
    }
    
    .stats-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .stats-card-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .stats-card h5 {
        font-size: 0.85rem;
    }
    
    .stats-card h2 {
        font-size: 1.8rem;
    }
    
    .stats-card small {
        font-size: 0.75rem;
    }
    
    .main-card {
        padding: 1.5rem;
        border-radius: 20px;
        margin-bottom: 1.5rem;
    }
    
    .main-card h4 {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    .form-control-custom {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .btn-custom-primary {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .btn-custom-success {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .students-panel {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .student-btn {
        padding: 15px;
        font-size: 0.85rem;
    }
    
    .student-btn i {
        font-size: 1.5rem !important;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .settings-content {
        width: 90%;
        padding: 2rem 1.5rem;
    }
    
    .settings-content h3 {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .settings-content .btn {
        padding: 12px;
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .login-box {
        width: 90%;
        padding: 2rem 1.5rem;
    }
    
    .login-box h3 {
        font-size: 1.3rem;
    }
    
    .login-box .form-control {
        padding: 12px 15px;
    }
    
    .login-box .btn-primary {
        padding: 12px;
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 60px;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .school-logo {
        width: 30px;
        height: 30px;
    }
    
    .school-name-ar {
        font-size: 0.75rem;
    }
    
    .school-name-en {
        display: none;
    }
    
    .nav-icon-btn {
        width: 35px;
        height: 35px;
        border-radius: 10px;
    }
    
    .nav-icon-btn i {
        font-size: 0.9rem;
    }
    
    .page-header h1 {
        font-size: 1.3rem;
    }
    
    .page-header p {
        font-size: 0.85rem;
    }
    
    .teacher-info-badge {
        font-size: 0.75rem;
        padding: 6px 15px;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stats-card h5 {
        font-size: 0.75rem;
    }
    
    .stats-card h2 {
        font-size: 1.5rem;
    }
    
    .main-card {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .main-card h4 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .main-card h4 i {
        font-size: 0.9rem;
    }
    
    .form-control-custom {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .form-label {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .btn-custom-primary {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
    
    .btn-custom-success {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
    
    .students-panel {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .student-btn {
        padding: 12px;
        border-radius: 12px;
    }
    
    .student-btn i {
        font-size: 1.2rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .student-btn div {
        font-size: 0.75rem !important;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .table tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn-danger-custom {
        padding: 6px 15px;
        font-size: 0.75rem;
    }
    
    .settings-content {
        width: 95%;
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .settings-content h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .settings-content .btn {
        padding: 10px;
        font-size: 0.85rem;
        margin-bottom: 10px;
    }
    
    .settings-content .btn i {
        font-size: 0.9rem;
    }
    
    .login-box {
        width: 95%;
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .login-box img {
        width: 60px !important;
    }
    
    .login-box h3 {
        font-size: 1.1rem;
    }
    
    .login-box .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .login-box .btn-primary {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    /* تحسين المسافات للهواتف */
    .row.g-3 {
        gap: 0.75rem !important;
    }
    
    .row.g-4 {
        gap: 1rem !important;
    }
    
    /* تحسين عرض الأعمدة على الهواتف */
    .col-md-4, .col-md-6, .col-md-12 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 400px) {
    .students-panel {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .student-btn {
        padding: 10px;
    }
    
    .student-btn i {
        font-size: 1rem !important;
    }
    
    .student-btn div {
        font-size: 0.7rem !important;
    }
}
.student-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.student-btn.absence {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.student-btn.no-absence {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.student-btn.default {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #666;
}