:root {
    --primary: #4e54c8;
    --secondary: #8f94fb;
    --accent: #ff6b6b;
    --light: #f8f9fa;
    --dark: #343a40;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f5f7fb;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    color: white;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-header img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 3px solid white;
}

.sidebar-menu i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-menu span {
    transition: all 0.3s ease;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Top Bar */
.top-bar {
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    position: sticky;
    top: 20px;
    z-index: 99;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--primary);
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 20px;
    padding-left: 45px;
    border-radius: 30px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.1);
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    border-radius: 40px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
}

.user-profile:hover {
    background: #f0f2f5;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-profile h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.user-profile small {
    font-size: 12px;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(78, 84, 200, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin-right: 15px;
}

.card-details h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--dark);
    line-height: 1.2;
}

.card-details p {
    color: #666;
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h5 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--dark);
}

.btn-view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-view-all:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Course Card */
.course-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    height: 100%;
    transition: all 0.3s;
}

.course-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.course-image {
    height: 180px;
    overflow: hidden;
}

.course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.course-card:hover .course-image img {
    transform: scale(1.1);
}

.course-content {
    padding: 20px;
}

.course-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.course-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.course-progress {
    margin-bottom: 20px;
}

.course-progress .d-flex {
    margin-bottom: 8px;
    font-size: 14px;
}

.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.progress-bar {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 4px;
}

.course-actions {
    display: flex;
    gap: 10px;
}

.course-actions .btn {
    flex: 1;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 84, 200, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1px;
}

.table {
    width: 100%;
    margin-bottom: 0;
    min-width: 600px;
}

.table th {
    font-weight: 600;
    color: var(--dark);
    border-top: none;
    padding: 15px 12px;
    background: #f8f9fa;
}

.table td {
    padding: 12px;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(78, 84, 200, 0.05);
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-paid, .badge-success {
    background: var(--success);
    color: white;
}

.badge-pending, .badge-warning {
    background: var(--warning);
    color: var(--dark);
}

/* Activity List */
.activity-list {
    padding: 0;
}

.activity-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(78, 84, 200, 0.1), rgba(143, 148, 251, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--primary);
    font-size: 18px;
}

.activity-content {
    flex: 1;
}

.activity-content h6 {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark);
}

.activity-content p {
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.activity-time {
    color: #999;
    font-size: 12px;
}

/* Workspace Items */
.workspace-item {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.workspace-item:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(78, 84, 200, 0.1);
}

/* Certificate Cards */
.certificate-card {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    padding: 25px 20px;
    transition: all 0.3s;
    height: 100%;
    background: white;
}

.certificate-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(78, 84, 200, 0.15);
}

.certificate-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 15px;
}

.certificate-card h5 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

/* Profile Page */
.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.form-control {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.1);
    outline: none;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 5px;
}

/* Page Display */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }
    
    .sidebar-header h3,
    .sidebar-menu span {
        display: none;
    }
    
    .sidebar-header {
        padding: 15px 5px;
    }
    
    .sidebar-header img {
        width: 45px;
        height: 45px;
        margin-bottom: 0;
    }
    
    .sidebar-menu a {
        padding: 15px;
        justify-content: center;
    }
    
    .sidebar-menu i {
        margin-right: 0;
        font-size: 20px;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }
    
    .search-box {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-card {
        padding: 15px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .card-details h3 {
        font-size: 24px;
    }
    
    .search-box {
        width: 200px;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .course-actions {
        flex-direction: column;
    }
    
    .course-actions .btn {
        width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    :root {
        --sidebar-width: 260px;
        --sidebar-collapsed-width: 0px;
    }
    
    .menu-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
    }
    
    .sidebar {
        width: var(--sidebar-width);
        left: calc(-1 * var(--sidebar-width));
        box-shadow: none;
    }
    
    .sidebar.show {
        left: 0;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.show .sidebar-header h3,
    .sidebar.show .sidebar-menu span {
        display: block;
    }
    
    .sidebar.show .sidebar-header img {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }
    
    .sidebar.show .sidebar-menu a {
        padding: 12px 20px;
        justify-content: flex-start;
    }
    
    .sidebar.show .sidebar-menu i {
        margin-right: 15px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
        padding-top: 70px;
    }
    
    .top-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        padding: 10px 15px;
        z-index: 998;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .search-box {
        width: 100%;
        margin: 0 10px;
    }
    
    .user-profile {
        padding: 3px 8px;
    }
    
    .user-profile h6 {
        display: none;
    }
    
    .stats-cards {
        margin-top: 10px;
    }
    
    .course-image {
        height: 160px;
    }
    
    .course-title {
        font-size: 16px;
    }
    
    .certificate-card {
        padding: 20px 15px;
    }
    
    .certificate-icon {
        font-size: 40px;
    }
    
    .certificate-card h5 {
        font-size: 16px;
    }
    
    .profile-img {
        width: 100px;
        height: 100px;
    }
    
    .btn {
        padding: 8px 16px;
    }
    
    .table td, 
    .table th {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .user-profile small {
        display: none;
    }
    
    .user-profile h6 {
        font-size: 12px;
    }
    
    .search-box input {
        padding: 8px 15px;
        padding-left: 35px;
        font-size: 13px;
    }
    
    .stats-card {
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }
    
    .sidebar-header {
        padding: 10px;
        min-height: auto;
    }
    
    .sidebar-header img {
        width: 40px;
        height: 40px;
    }
    
    .sidebar-menu a {
        padding: 8px 15px;
    }
    
    .main-content {
        padding-top: 60px;
    }
    
    .top-bar {
        padding: 8px 15px;
    }
}