/* ==================== Root Variables ==================== */
:root {
    /* Colors */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutrals */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Dark Theme Variables */
body.dark-theme {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* 페이지 전환 시 깜빡임 방지 */
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html.dark-theme {
    background-color: #0f172a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: opacity 0.15s ease-in-out;
    /* 렌더링 최적화 */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 페이지 로드 시 부드러운 전환 */
body.page-transition {
    opacity: 0.95;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== Sidebar Navigation ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    z-index: 1000;
    /* 렌더링 최적화 */
    will-change: transform;
    contain: layout style paint;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.5rem;
}

.sidebar-toggle {
    display: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--text-primary);
}

.user-profile {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    position: relative;
    flex-shrink: 0;
}

.user-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.status-indicator.online {
    background-color: var(--success-color);
}

.user-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.nav-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    list-style: none;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item a:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.nav-item.active a {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
}

.nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 0 2px 2px 0;
}

.nav-item i {
    font-size: 1.125rem;
    width: 20px;
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.nav-item .badge.new {
    background-color: var(--danger-color);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

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

/* ==================== Main Content Area ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
    /* 화면 번쩍임 방지 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* ==================== Top Header ==================== */
.top-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    display: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.menu-toggle:hover {
    color: var(--text-primary);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
    margin: 0 2rem;
}

.search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.search-bar kbd {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    border: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    position: relative;
}

.user-menu:hover {
    background-color: var(--bg-secondary);
}

.user-menu img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* ==================== Content Wrapper ==================== */
.content-wrapper {
    padding: 2rem;
    overflow-x: hidden;
    width: 100%;
}

/* ==================== Welcome Section ==================== */
.welcome-section {
    background: var(--gradient-primary);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.welcome-content h1 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.welcome-content p {
    opacity: 0.9;
    font-size: 1rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ==================== Statistics Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

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

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-value span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.25rem;
}

.stat-change {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

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

/* ==================== Course Progress Section ==================== */
.course-progress-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-all {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap var(--transition-fast);
}

.view-all:hover {
    gap: 0.5rem;
}

.progress-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.progress-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.progress-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.course-thumbnail {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.progress-card:hover .course-thumbnail img {
    transform: scale(1.05);
}

.course-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-info {
    padding: 1.25rem;
}

.course-category {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-info h3 {
    margin: 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.course-instructor {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
}

.course-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.course-meta span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-continue {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-continue:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==================== Course Catalog Section ==================== */
.course-catalog-section {
    margin-bottom: 3rem;
}

.catalog-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.filter-btn:hover {
    background-color: var(--bg-secondary);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.catalog-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.catalog-card:hover .card-image img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.catalog-card:hover .card-overlay {
    opacity: 1;
}

.preview-btn {
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: #1e293b !important;
    border-radius: 8px;
    font-weight: 600;
    transform: translateY(20px);
    transition: transform var(--transition-base);
    border: none;
    cursor: pointer;
}

.catalog-card:hover .preview-btn {
    transform: translateY(0);
}

.preview-btn:hover {
    background-color: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.course-level {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--info-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-level.intermediate {
    background-color: var(--warning-color);
}

.course-level.advanced {
    background-color: var(--danger-color);
}

.card-content {
    padding: 1.25rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-tag {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--warning-color);
    font-weight: 600;
}

.card-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.course-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.course-details {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.course-details span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    display: flex;
    flex-direction: column;
}

.original-price {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.btn-enroll {
    padding: 0.625rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-enroll:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ==================== Analytics Section ==================== */
.analytics-section {
    margin-bottom: 3rem;
}

.period-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-card,
.achievement-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.chart-card h3,
.achievement-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.chart-placeholder {
    height: 250px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-chart {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    width: 100%;
    height: 100%;
    padding: 1rem;
}

.bar {
    flex: 1;
    background: var(--gradient-primary);
    border-radius: 8px 8px 0 0;
    position: relative;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
}

.bar span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.badge-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.badge-icon.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
}

.badge-icon.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #808080 100%);
}

.badge-icon.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8b4513 100%);
}

.badge-icon.special {
    background: var(--gradient-primary);
}

.badge-item span {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* ==================== Mobile Navigation ==================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem;
    z-index: 999;
    justify-content: space-around;
}

/* Mobile Navigation Bar - 성능 최적화 */
.mobile-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--text-secondary);
    transition: none; /* 모바일에서 트랜지션 제거 */
    -webkit-tap-highlight-color: transparent; /* 터치 하이라이트 제거 */
    touch-action: manipulation; /* 더블 탭 줌 방지 */
}

.mobile-nav .nav-item.active {
    color: var(--primary-color);
}

.mobile-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.mobile-nav .nav-item span {
    font-size: 0.625rem;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
        z-index: 1100;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    /* 기본 레이아웃 */
    .content-wrapper {
        padding: 1rem;
        padding-bottom: 80px;
    }
    
    /* 모바일에서 애니메이션 성능 최적화 */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    
    /* 하드웨어 가속 비활성화 */
    body {
        transform: none !important;
        will-change: auto !important;
    }
    
    .sidebar {
        will-change: auto !important;
    }
    
    /* 모바일 네비게이션 */
    .mobile-nav {
        display: flex;
        background: var(--bg-primary);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* 헤더 조정 */
    .top-header {
        padding: 0 1rem;
        height: 60px;
    }
    
    .search-bar {
        margin: 0 0.5rem;
        flex: 1;
    }
    
    .search-bar input {
        padding: 0.625rem 2.5rem 0.625rem 2.25rem;
        font-size: 0.875rem;
    }
    
    .search-bar kbd {
        display: none;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
    }
    
    /* 웰컴 섹션 */
    .welcome-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .welcome-content h1 {
        font-size: 1.5rem;
    }
    
    .quick-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 통계 그리드 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* 코스 카드 */
    .progress-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .course-thumbnail {
        height: 150px;
    }
    
    /* 카탈로그 필터 */
    .catalog-filters {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 섹션 헤더 정렬 수정 */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header .catalog-filters {
        width: 100%;
    }
    
    .catalog-filters::-webkit-scrollbar {
        height: 4px;
    }
    
    /* 카탈로그 그리드 */
    .catalog-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* 배지 그리드 */
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .badge-item {
        padding: 0.75rem;
    }
    
    /* 사이드바 */
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
    .user-profile {
        padding: 1rem;
    }
    
    .nav-item a {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    /* 헤더 컨테이너 */
    .top-header {
        padding: 0 0.75rem;
    }
    
    .header-actions {
        gap: 0.25rem;
    }
    
    .user-menu {
        padding: 0.25rem;
    }
    
    .user-menu img {
        width: 28px;
        height: 28px;
    }
    
    .user-menu i {
        display: none;
    }
    
    /* 콘텐트 영역 */
    .content-wrapper {
        padding: 0.75rem;
        padding-bottom: 70px;
    }
    
    /* 섹션 헤더 */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .section-header h2 {
        font-size: 1.125rem;
    }
    
    /* 통계 카드 */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }
    
    .stat-icon {
        margin-bottom: 0;
    }
    
    /* 코스 카드 */
    .course-thumbnail {
        height: 120px;
    }
    
    .course-info {
        padding: 1rem;
    }
    
    /* 카탈로그 카드 */
    .card-content {
        padding: 1rem;
    }
    
    .course-details {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-enroll {
        width: 100%;
    }
    
    /* 배지 */
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    /* 모바일 네비게이션 */
    .mobile-nav {
        padding: 0.375rem;
    }
    
    .mobile-nav .nav-item {
        padding: 0.375rem;
    }
    
    .mobile-nav .nav-item i {
        font-size: 1.125rem;
    }
    
    .mobile-nav .nav-item span {
        font-size: 0.625rem;
    }
    
    /* 사이드바 */
    .sidebar {
        width: 100vw;
        max-width: 100vw;
    }
    
    /* 웰컴 섹션 */
    .welcome-content h1 {
        font-size: 1.25rem;
    }
    
    .welcome-content p {
        font-size: 0.875rem;
    }
}

/* ==================== Loading States ==================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ==================== View Transitions ==================== */
/* 데스크탑에서만 적용 */
@media (min-width: 769px) {
    @view-transition {
        navigation: auto;
    }

    ::view-transition-old(root) {
        animation: fade-out 0.2s ease-out;
    }

    ::view-transition-new(root) {
        animation: fade-in 0.2s ease-out;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn var(--transition-slow) ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ==================== Utility Classes ==================== */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ==================== Custom Scrollbar for Dark Theme ==================== */
body.dark-theme::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

body.dark-theme::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
}

/* ==================== Print Styles ==================== */
@media print {
    .sidebar,
    .top-header,
    .mobile-nav {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 0;
    }
}