/* Main CSS File for Computer Society Attendance Management System */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #1f2937;
    --dark-surface: #374151;
    --dark-text: #f3f4f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Aptos', 'Aptos (Body)', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Dark mode styles */
body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

body.dark-mode .bg-white {
    background-color: var(--dark-surface);
    color: var(--dark-text);
}

body.dark-mode .text-gray-800 {
    color: var(--dark-text);
}

body.dark-mode .text-gray-600 {
    color: #9ca3af;
}

/* Mobile Sidebar for Students */
@media (max-width: 767px) {
    /* Hide sidebar by default on mobile */
    #sidebar.mobile-hidden {
        transform: translateX(-100%) !important;
    }
    
    /* Show sidebar when toggled */
    #sidebar.mobile-show {
        transform: translateX(0) !important;
    }
    
    /* Show overlay when sidebar is visible */
    #sidebarOverlay:not(.hidden) {
        display: block !important;
    }
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Card styles */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

body.dark-mode .card {
    background: var(--dark-surface);
}

/* Button styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #059669;
}

/* Table styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

body.dark-mode .table th,
body.dark-mode .table td {
    border-bottom-color: #4b5563;
}

.table th {
    background-color: #f9fafb;
    font-weight: 600;
}

body.dark-mode .table th {
    background-color: #4b5563;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

body.dark-mode .form-control {
    background-color: #4b5563;
    border-color: #6b7280;
    color: var(--dark-text);
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

body.dark-mode .alert-success {
    background-color: #064e3b;
    color: #6ee7b7;
}

body.dark-mode .alert-error {
    background-color: #7f1d1d;
    color: #fca5a5;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.p-4 { padding: 1rem; }
.p-8 { padding: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .card {
        padding: 1rem;
    }
}

/* Mobile Sidebar for Students - Hide by default */
@media (max-width: 767px) {
    /* Force hide sidebar on mobile by default - use display none */
    #sidebar {
        display: none !important;
    }
    
    /* Show sidebar when toggled */
    #sidebar.mobile-show {
        display: block !important;
        transform: translateX(0) !important;
        left: 0 !important;
    }
    
    /* Show overlay when sidebar is visible */
    #sidebarOverlay:not(.hidden) {
        display: block !important;
    }
}

/* Desktop - always show sidebar */
@media (min-width: 768px) {
    #sidebar {
        display: block !important;
    }
}

/* Mobile responsive improvements */
@media (max-width: 767px) {
    /* Ensure tables are scrollable on mobile */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    /* Better spacing for mobile cards */
    .card, .bg-white {
        padding: 1rem !important;
    }
    
    /* Smaller text on mobile for better readability */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.25rem !important;
    }
    
    h3 {
        font-size: 1.125rem !important;
    }
    
    /* Better button spacing on mobile */
    button, .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }
    
    /* DataTables mobile improvements */
    .dataTables_wrapper {
        font-size: 0.875rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_length {
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        font-size: 0.75rem;
        padding: 0.5rem 0;
    }
}

