:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #3498db;
    --light-accent: #e3f2fd;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --sidebar-width: 260px;
    --header-height: 70px;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: var(--transition);
}

.header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
}

.brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.brand:hover {
    color: var(--accent-color);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 12px;
    font-size: 1.2rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.header-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
    padding: 5px 0;
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}

.search-container {
    position: relative;
    width: 250px;
}

.search-input {
    width: 100%;
    padding: 8px 40px 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background-color: #f8f9fa;
    transition: var(--transition);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    padding: 5px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--accent-color);
}

.profile-dropdown {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 25px;
    transition: var(--transition);
}

.profile-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.profile-name {
    font-weight: 500;
    color: var(--primary-color);
}

.profile-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
}

.profile-dropdown.active .profile-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.profile-dropdown-item:hover {
    background-color: var(--light-accent);
}

.profile-dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.profile-dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #f0f0f0;
    color: var(--danger-color);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.sidebar-item:hover {
    background-color: var(--light-accent);
}

.sidebar-item.active {
    background-color: var(--light-accent);
    color: var(--accent-color);
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--accent-color);
}

.sidebar-icon {
    font-size: 1.2rem;
    margin-right: 15px;
    width: 24px;
    text-align: center;
}

.sidebar-text {
    font-weight: 500;
    flex: 1;
}

.sidebar-badge {
    background-color: var(--accent-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 25px;
    min-height: calc(100vh - var(--header-height));
}

/* Dashboard Cards */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.dashboard-subtitle {
    color: #777;
    font-size: 0.95rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-title {
    font-size: 0.9rem;
    color: #777;
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.primary {
    background-color: var(--light-accent);
    color: var(--accent-color);
}

.stat-icon.success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.stat-icon.warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.stat-icon.danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Content Card */
.content-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header-custom {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.card-body-custom {
    padding: 25px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid #f0f0f0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 15px;
    border-bottom: 1px solid #f8f9fa;
    color: #555;
}

.custom-table tr:hover {
    background-color: #f8f9fa;
}

.course-name {
    font-weight: 600;
    color: var(--primary-color);
}

.course-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: var(--light-accent);
    color: var(--accent-color);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.active {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.status-badge.pending {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.status-badge.inactive {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

/* Dropdown Actions */
.action-dropdown {
    position: relative;
}

.action-btn {
    background: none;
    border: none;
    color: #777;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.action-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.action-dropdown.active .action-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.action-item:hover {
    background-color: #f8f9fa;
}

.action-item:first-child {
    border-radius: 8px 8px 0 0;
}

.action-item:last-child {
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #f0f0f0;
    color: var(--danger-color);
}

/* Filter Dropdown */
.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--accent-color);
    background-color: var(--light-accent);
}

.filter-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
    padding: 10px 0;
}

.filter-dropdown.active .filter-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-option:hover {
    background-color: #f8f9fa;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    accent-color: var(--accent-color);
}

/* Form Styles */
.form-section {
    margin-bottom: 30px;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.form-control-custom {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control-custom.is-invalid {
    border-color: var(--danger-color);
}

.form-control-custom.is-valid {
    border-color: var(--success-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

.valid-feedback {
    color: var(--success-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

.input-group-custom {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.input-group-custom .form-control-custom {
    padding-left: 40px;
}

/* input-group-append and .input-group-text were removed from the form; helper styles kept minimal if needed later */

/* Custom Select */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #777;
}

/* Textarea */
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* File Input */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: var(--transition);
}

.file-input-label:hover {
    border-color: var(--accent-color);
    background-color: var(--light-accent);
}

.file-input-text {
    color: #777;
    font-weight: 500;
}

/* Range Input */
.range-container {
    margin-top: 10px;
}

.range-value {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--light-accent);
    color: var(--accent-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 10px;
}

.range-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: var(--transition);
}

.range-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Checkbox and Radio */
.form-check-custom {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-check-input-custom {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.form-check-label-custom {
    color: var(--primary-color);
    cursor: pointer;
}

/* Buttons */
.btn-custom {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary-custom {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary-custom:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(52, 152, 219, 0.3);
}

.btn-secondary-custom {
    background-color: #e0e0e0;
    color: var(--primary-color);
}

.btn-secondary-custom:hover {
    background-color: #d0d0d0;
}

.btn-danger-custom {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger-custom:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.3);
}

.btn-group-custom {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Modal Styles */
.modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-custom.show {
    display: flex;
    opacity: 1;
}

.modal-content-custom {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-custom.show .modal-content-custom {
    transform: scale(1);
}

.modal-header-custom {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title-custom {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #777;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body-custom {
    padding: 25px;
}

.modal-footer-custom {
    padding: 15px 25px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .filter-container {
        flex-direction: column;
    }

    .search-container {
        width: 100%;
    }
}

/* Utility Classes */
.text-muted-custom {
    color: #777;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.1);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-message {
    flex: 1;
    color: var(--primary-color);
}

.toast-close {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
}