/* Main Stylesheet */

/* Custom Variables */
:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #10B981;
    --accent: #8B5CF6;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #06B6D4;
    --light: #F9FAFB;
    --dark: #1F2937;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
}

/* Custom Card Styles */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
}

.card-title {
    font-weight: 600;
    color: var(--gray-800);
}

/* Button Styles */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Table Styles */
.table {
    color: var(--gray-700);
}

.table thead th {
    font-weight: 600;
    color: var(--gray-800);
    background-color: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
}

.table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.03);
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.nav-link {
    font-weight: 500;
    color: var(--gray-700);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.nav-link.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.25em 0.75em;
    border-radius: 9999px;
    font-size: 0.75rem;
}

.badge.bg-primary { background-color: var(--primary); }
.badge.bg-success { background-color: var(--secondary); }
.badge.bg-warning { background-color: var(--warning); }
.badge.bg-danger { background-color: var(--danger); }
.badge.bg-info { background-color: var(--info); }
.badge.bg-purple { background-color: var(--accent); }

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.alert-info {
    background-color: #E0F2FE;
    color: #075985;
}

/* Progress Bars */
.progress {
    height: 0.75rem;
    border-radius: 9999px;
    background-color: var(--gray-200);
}

.progress-bar {
    border-radius: 9999px;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Timetable Specific */
.timetable-cell {
    position: relative;
    min-height: 80px;
    background: white;
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.timetable-cell.dragging-over {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.timetable-cell.has-subject {
    background-color: var(--light);
}

.break-cell {
    background-color: #FEF3C7;
    color: #92400E;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 0.375rem 1rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }
    
    .timetable-cell {
        break-inside: avoid;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Utility Classes */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-accent { background-color: var(--accent) !important; }

.border-primary { border-color: var(--primary) !important; }
.border-secondary { border-color: var(--secondary) !important; }

/* Footer Styles */
.footer {
    background-color: var(--dark) !important;
    color: white !important;
    margin-top: 3rem;
    padding: 3rem 0 1.5rem !important;
    border-top: 3px solid var(--primary);
}

.footer h5 {
    color: white !important;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer h6 {
    color: white !important;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.footer .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

.footer a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: white !important;
}

.footer ul.list-unstyled {
    padding-left: 0;
    list-style: none;
}

.footer ul.list-unstyled li {
    margin-bottom: 0.5rem;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1;
}

/* Ensure footer is always visible */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}