/*
 * JoziLearning - Custom Styles
 * Responsive layout with collapsible sidebar navigation
 */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding-top: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: white;
    color: white;
}

.sidebar-menu a.active {
    background: rgba(255,255,255,0.15);
    border-left-color: white;
    color: white;
    font-weight: 600;
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-menu .menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    padding: 15px 20px 5px;
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    padding: 0;
}

.main-content.expanded {
    margin-left: 0;
}

/* Top Navigation Bar */
.top-navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-gray);
    padding: 5px 10px;
    transition: all 0.3s;
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 14px;
}

.user-level {
    font-size: 12px;
    color: #6c757d;
}

/* Content Container */
.content-container {
    padding: 30px;
}

/* Dashboard Cards */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    margin-bottom: 20px;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-card-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.stat-card-icon.danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 5px;
}

.stat-card-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* Game Cards */
.game-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.game-card-image {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.game-card-body {
    padding: 20px;
}

.game-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-gray);
}

.game-card-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.game-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.game-status.completed {
    background: #d4edda;
    color: #155724;
}

.game-status.pending {
    background: #fff3cd;
    color: #856404;
}

/* Progress Bars */
.progress-container {
    margin-bottom: 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.progress {
    height: 10px;
    border-radius: 10px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* Badges and Pills */
.badge-custom {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-streak {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: white;
}

.badge-points {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.badge-level {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* Buttons */
.btn-custom {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Leaderboard */
.leaderboard-item {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.leaderboard-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transform: translateX(5px);
}

.leaderboard-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.leaderboard-rank.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

.leaderboard-rank.silver {
    background: linear-gradient(135deg, #c0c0c0, #e0e0e0);
    color: #333;
}

.leaderboard-rank.bronze {
    background: linear-gradient(135deg, #cd7f32, #e9a66d);
    color: white;
}

.leaderboard-info {
    flex: 1;
    margin-left: 15px;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 16px;
}

.leaderboard-stats {
    font-size: 13px;
    color: #6c757d;
}

.leaderboard-score {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Alerts */
.alert-custom {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-custom i {
    margin-right: 10px;
}

/* Form Styles */
.form-custom {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.form-custom .form-group {
    margin-bottom: 20px;
}

.form-custom label {
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 8px;
    display: block;
}

.form-custom input,
.form-custom select,
.form-custom textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-custom input:focus,
.form-custom select:focus,
.form-custom textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }

    .sidebar.active {
        margin-left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-container {
        padding: 15px;
    }

    .top-navbar {
        padding: 15px;
    }

    .user-details {
        display: none;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .game-card-image {
        height: 150px;
        font-size: 48px;
    }
}

@media (max-width: 576px) {
    .stat-card {
        padding: 15px;
    }

    .game-card-body {
        padding: 15px;
    }

    .leaderboard-score {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .menu-toggle {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Utility Classes */
.text-primary-custom {
    color: var(--primary-color);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.shadow-sm {
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.shadow-md {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.shadow-lg {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.rounded-lg {
    border-radius: 15px;
}

.mt-custom {
    margin-top: 30px;
}

.mb-custom {
    margin-bottom: 30px;
}
