:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 60px;
}

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

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

.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar Styles */
.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 5px;
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: rotate(90deg);
}

.sidebar-header h3 {
    color: #fff;
    font-weight: 600;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.sidebar .components {
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.sidebar .components::-webkit-scrollbar {
    width: 6px;
}

.sidebar .components::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}

.sidebar .components::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar .components::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.sidebar .components li {
    margin: 0;
}

.sidebar .components .nav-link {
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .components .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--primary-color);
    padding-left: 25px;
}

.sidebar .components .nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: #fff;
    border-left-color: var(--primary-color);
}

.sidebar .components .nav-link i {
    width: 25px;
    font-size: 1.2rem;
    margin-right: 10px;
}

/* Content Area */
.content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
    margin-left: var(--sidebar-width);
}

.sidebar.active ~ .content {
    margin-left: 0;
}

/* Top Navbar */
.navbar {
    height: var(--topbar-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e0e0e0;
}

#sidebarCollapse {
    border: none;
    background: transparent;
    color: var(--primary-color);
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
}

#sidebarCollapse:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Dashboard Cards */
.stat-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.stat-card .stat-icon.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.stat-card .stat-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.stat-card .stat-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.stat-card .stat-icon.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
}

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Module Cards */
.module-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
    height: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.module-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    transition: all 0.5s;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.module-card:hover::after {
    opacity: 1;
    transform: scale(1);
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.module-card .module-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.module-card:hover .module-icon {
    transform: scale(1.1) rotate(5deg);
}

.module-card .module-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.module-card .module-desc {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.module-card .btn {
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.module-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Poster Cards */
.poster-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
    height: 100%;
}

.poster-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.poster-card img {
    transition: transform 0.3s;
}

.poster-card:hover img {
    transform: scale(1.05);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 20px;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

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

/* Tables */
.table {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
}

.table thead {
    background: #f8f9fa;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #2c3e50;
}

.table tbody tr {
    transition: all 0.3s;
}

.table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 10px 15px;
    transition: all 0.3s;
}

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

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .sidebar.active .sidebar-close-btn {
        display: block;
    }
    
    .content {
        margin-left: 0;
    }
    
    .stat-card {
        margin-bottom: 20px;
    }
}

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

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

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

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

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

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