:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --success-color: #1cc88a;
    --danger-color: #e74a3b;
    --warning-color: #f6c23e;
    --info-color: #36b9cc;
    --dark-color: #2c3e50;
    --light-color: #f8f9fc;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.brand-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 2rem;
}

.brand-subtitle {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Sidebar */
.sidebar {
    width: 250px;
    min-height: calc(100vh - 56px);
    transition: all 0.3s;
    position: sticky;
    top: 56px;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.sidebar .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.35rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.sidebar-header {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Content Area */
.content {
    flex: 1;
    min-height: calc(100vh - 56px);
    background-color: #f5f6fa;
}

/* Statistics Cards */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: transform 0.2s;
}

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

.stat-card .card-body {
    padding: 1.25rem;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--secondary-color);
    border-bottom: 2px solid #e3e6f0;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Alert */
.alert {
    border-radius: 0.5rem;
    border: none;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid #d1d3e2;
    padding: 0.625rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
}

/* Badge */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
    border-radius: 0.35rem;
}

/* Modal */
.modal-content {
    border-radius: 0.75rem;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e3e6f0;
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #e3e6f0;
    padding: 1rem;
}

/* Landing Page */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5rem 0;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.feature-box {
    padding: 2rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Responsive Design - Mobile First */

/* Mobile devices (up to 576px) */
@media (max-width: 576px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        width: 250px;
        left: -250px;
        transition: left 0.3s;
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .hero-section {
        padding: 3rem 0;
        min-height: auto;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .stat-card .card-body h3 {
        font-size: 1.5rem;
    }
    
    .stat-card .card-body h6 {
        font-size: 0.75rem;
    }
    
    .stat-card .card-body i {
        font-size: 2rem !important;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Tablet devices (577px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
}

/* Desktop devices (769px and up) */
@media (min-width: 769px) {
    .sidebar {
        display: block !important;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* Mobile Menu Toggle */
@media (max-width: 768px) {
    #sidebarToggle {
        display: block !important;
    }
}

/* Video Responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* List Group */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e3e6f0;
    padding: 1rem 0;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Book Card */
.book-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15) !important;
}

.book-card img {
    height: 250px;
    object-fit: cover;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Progress Bar Custom */
.progress {
    height: 1.5rem;
    border-radius: 0.5rem;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 0.5rem;
    font-weight: 600;
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-custom {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Print Styles */
@media print {
    .sidebar, .navbar, .btn, .card-header {
        display: none !important;
    }
    
    .content {
        margin-left: 0 !important;
    }
}
