/* ============ VARIABLES ============ */
:root {
    --bg-black: #0a0a0a;
    --bg-dark: #121212;
    --bg-gray: #1e1e1e;
    --bg-light: #2d2d2d;
    --text: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-light: #ffffff;
    --primary: #00bfff;
    --primary-dark: #0099cc;
    --purple: #8a2be2;
    --pink: #ff007f;
    --success: #00ff00;
    --warning: #ffaa00;
    --danger: #ff4444;
    --gradient: linear-gradient(135deg, #8a2be2, #00bfff);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    
    /* Touch */
    --touch: 44px;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    
    /* Font */
    --font-xs: 12px;
    --font-sm: 14px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 20px;
    --font-2xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-black);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* ============ TOP NAVBAR ============ */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--bg-black);
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    z-index: 1000;
}

.logo {
    font-size: var(--font-lg);
    font-weight: 600;
    color: white;
}

.logo span {
    color: var(--primary);
}

.menu-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-gray);
    border: 1px solid #333;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ============ SIDEBAR ============ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1001;
    display: none;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-black);
    border-right: 1px solid #333;
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: var(--space-xl) 0;
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    margin-bottom: var(--space-xl);
}

.sidebar-logo {
    font-size: var(--font-lg);
    font-weight: 600;
    color: white;
}

.sidebar-logo span {
    color: var(--primary);
}

.sidebar-close {
    width: 36px;
    height: 36px;
    background: var(--bg-gray);
    border: 1px solid #333;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-gray);
    margin: 0 var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
}

.sidebar-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-lg);
    font-weight: 600;
    color: white;
}

.sidebar-user-info h4 {
    font-size: var(--font-sm);
    color: white;
    margin-bottom: 2px;
}

.sidebar-user-info p {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.sidebar-menu {
    list-style: none;
    padding: 0 var(--space-md);
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-sm);
}

.sidebar-menu a i {
    width: 20px;
}

.sidebar-menu a.active {
    background: var(--bg-gray);
    color: var(--primary);
}

.logout-link {
    margin-top: var(--space-xl);
    border-top: 1px solid #333;
    padding-top: var(--space-xl);
}

.logout-link a {
    color: var(--pink) !important;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-top: 56px;
    padding: var(--space-lg);
    min-height: calc(100vh - 56px);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: var(--font-xl);
    color: white;
    margin-bottom: 4px;
}

.page-header p {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

/* ============ ALERTS ============ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-sm);
}

.alert-success {
    background: rgba(0,255,0,0.1);
    border-left: 4px solid var(--success);
    color: #aaffaa;
}

.alert-error {
    background: rgba(255,0,0,0.1);
    border-left: 4px solid var(--danger);
    color: #ff8888;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-gray);
    border-radius: var(--radius-2xl);
    padding: var(--space-lg);
    border: 1px solid #333;
    margin-bottom: var(--space-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.card-header i {
    font-size: var(--font-lg);
    color: var(--primary);
}

.card-header h2 {
    font-size: var(--font-lg);
    color: white;
    margin-bottom: 0;
}

/* ============ BUTTONS ============ */
.btn {
    min-height: 44px;
    padding: 0 var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid #333;
    color: var(--text-muted);
}

.btn-block {
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

/* ============ STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid #333;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(0,191,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: var(--font-lg);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: var(--font-lg);
    font-weight: 600;
    color: white;
    line-height: 1.2;
}

.stat-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* ============ SECTION HEADER ============ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title i {
    font-size: var(--font-lg);
    color: var(--primary);
}

.section-title h2 {
    font-size: var(--font-lg);
    color: white;
    margin-bottom: 0;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-sm);
}

/* ============ COURSE LIST ============ */
.course-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.course-card {
    background: var(--bg-gray);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    border: 1px solid #333;
    display: flex;
}

.course-thumb {
    width: 100px;
    height: 100px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    flex-shrink: 0;
}

.course-content {
    flex: 1;
    padding: var(--space-md);
}

.course-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.course-meta {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.progress-bar {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin: 4px 0;
}

.progress-fill {
    height: 4px;
    background: var(--success);
    border-radius: 2px;
}

.btn-continue {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-xs);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ============ POSTS ============ */
.timeline {
    background: var(--bg-gray);
    border-radius: var(--radius-2xl);
    padding: var(--space-lg);
    border: 1px solid #333;
}

.post-card {
    background: var(--bg-black);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    border: 1px solid #333;
}

.post-header {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.post-author {
    flex: 1;
}

.post-author h4 {
    font-size: var(--font-sm);
    color: white;
    margin-bottom: 2px;
}

.post-time {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.post-content {
    font-size: var(--font-sm);
    margin-bottom: var(--space-sm);
    padding-left: 48px;
}

.post-media {
    margin-bottom: var(--space-sm);
    padding-left: 48px;
}

.post-media img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.post-actions {
    display: flex;
    gap: var(--space-xl);
    padding-left: 48px;
    padding-top: var(--space-sm);
    border-top: 1px solid #333;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    background: none;
    border: none;
    font-size: var(--font-sm);
    cursor: pointer;
}

.action-btn.liked {
    color: var(--pink);
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    background: var(--bg-gray);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: var(--space-xl);
    border: 1px solid #333;
}

.tab-btn {
    flex: 1;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-sm);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--gradient);
    color: white;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    color: white;
    font-size: var(--font-sm);
    font-weight: 500;
}

.form-control {
    width: 100%;
    min-height: 44px;
    padding: 0 var(--space-md);
    background: var(--bg-black);
    border: 1px solid #333;
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--font-md);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    padding: var(--space-md);
    min-height: 100px;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    background: var(--bg-gray);
    border-radius: var(--radius-2xl);
    border: 1px solid #333;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    font-size: var(--font-md);
    color: white;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* ============ RESPONSIVE ============ */
@media (min-width: 768px) {
    .top-navbar {
        display: none;
    }
    
    .sidebar {
        left: 0;
        width: 240px;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        margin-left: 240px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .course-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sidebar {
        width: 260px;
    }
    
    .course-list {
        grid-template-columns: repeat(3, 1fr);
    }
}