/* Custom CSS for School Strength Declaration Form */

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    padding: 20px 0;
}

.card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
}

.card-body {
    padding: 2rem;
}

.form-label {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: 10px;
    border: 2px solid #e3e6f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.table-bordered {
    border: 2px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(102, 126, 234, 0.05);
}

.student-count {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    text-align: center;
}

.student-count:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.1rem rgba(102, 126, 234, 0.25);
}

.total-cell {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
    vertical-align: middle;
    font-size: 1.1rem;
}

.table-warning {
    background-color: #fff3cd;
}

.table-warning td {
    font-weight: bold;
    font-size: 1.1rem;
    color: #856404;
}

.btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.text-justify {
    text-align: justify;
    line-height: 1.6;
    color: #495057;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .student-count {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 2rem;
    }
    
    .total-cell {
        font-size: 1rem;
    }
    
    .table-warning td {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px 0;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .student-count {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .me-3 {
        margin-right: 0 !important;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .btn {
        display: none;
    }
    
    .form-control {
        border: 1px solid #000;
        background: white;
    }
}

/* Animation for form validation */
.is-invalid {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Loading animation */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
