/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f9fb;
    color: #1e1e2e;
    line-height: 1.6;
    min-height: 100vh;
}
a { color: #4a6cf7; text-decoration: none; }
a:hover { color: #3451d1; }

/* ===== Navbar ===== */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px; height: 60px;
    background: #fff; border-bottom: 1px solid #e5e7eb;
}
.navbar-brand {
    font-size: 18px; font-weight: 700; color: #4a6cf7;
    display: flex; align-items: center; gap: 8px;
}
.navbar-brand:hover { text-decoration: none; color: #3451d1; }
.navbar-nav {
    display: flex; align-items: center; gap: 4px; list-style: none;
}
.navbar-nav a {
    color: #6b7280; font-size: 14px; padding: 8px 14px;
    border-radius: 8px; transition: all 0.15s; font-weight: 500;
}
.navbar-nav a:hover { background: #f3f4f6; color: #1e1e2e; text-decoration: none; }
.navbar-nav a.active { background: #eef2ff; color: #4a6cf7; }
.navbar-user {
    display: flex; align-items: center; gap: 12px;
    color: #6b7280; font-size: 13px;
}

/* ===== Container ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 32px 24px; }
.container-md { max-width: 720px; margin: 0 auto; padding: 32px 24px; }

/* ===== Cards ===== */
.card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
    padding: 24px; margin-bottom: 16px; transition: all 0.2s;
}
.card:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f3f4f6;
}
.card-title { font-size: 17px; font-weight: 600; color: #1e1e2e; }
.card-subtitle { font-size: 13px; color: #9ca3af; margin-top: 4px; }

/* ===== Course Card (대시보드 전용) ===== */
.course-card {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
    overflow: hidden; transition: all 0.25s; margin-bottom: 20px;
}
.course-card:hover { border-color: #4a6cf7; box-shadow: 0 4px 20px rgba(74,108,247,0.08); transform: translateY(-2px); }
.course-card-accent { height: 4px; }
.course-card-accent-python { background: linear-gradient(90deg, #f59e0b, #eab308); }
.course-card-accent-scratch { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.course-card-body { padding: 24px; }
.course-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.course-card-title { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.course-card-desc { font-size: 13px; color: #6b7280; line-height: 1.5; margin-bottom: 20px; }
.course-card-stats { display: flex; gap: 24px; margin-bottom: 20px; }
.course-card-stat { display: flex; flex-direction: column; }
.course-card-stat-value { font-size: 22px; font-weight: 700; color: #111827; }
.course-card-stat-label { font-size: 11px; color: #9ca3af; letter-spacing: 0.5px; }
.course-card-footer { padding: 16px 24px; border-top: 1px solid #f3f4f6; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px; font-size: 13px;
    font-weight: 600; color: #374151;
}
.form-input, select, textarea {
    width: 100%; padding: 10px 14px; font-size: 14px;
    background: #fff; border: 1px solid #d1d5db; border-radius: 8px;
    color: #1e1e2e; transition: border-color 0.2s;
    font-family: inherit;
}
.form-input:focus, select:focus, textarea:focus {
    outline: none; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}
textarea.code-textarea {
    font-family: 'Consolas', 'D2Coding', 'Fira Code', monospace;
    font-size: 13px; line-height: 1.5;
}
.form-help { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.form-errors { color: #ef4444; font-size: 12px; margin-top: 4px; }
.form-errors li { list-style: none; }
.form-error { color: #ef4444; font-size: 12px; margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 20px; font-size: 14px; font-weight: 500;
    border: none; border-radius: 8px; cursor: pointer;
    transition: all 0.15s; text-decoration: none; line-height: 1.4;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: #4a6cf7; color: #fff; }
.btn-primary:hover { background: #3b5de7; color: #fff; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-outline { background: transparent; border: 1px solid #d1d5db; color: #6b7280; }
.btn-outline:hover { border-color: #4a6cf7; color: #4a6cf7; background: #fafbff; }
.btn-sm { padding: 5px 14px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
    font-size: 14px; border: 1px solid;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error, .alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ===== Progress Bar ===== */
.progress-bar {
    height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden;
}
.progress-bar-fill, .progress-fill {
    height: 100%; border-radius: 3px; transition: width 0.3s;
    background: linear-gradient(90deg, #4a6cf7, #10b981);
}

/* ===== Badge ===== */
.badge {
    display: inline-block; padding: 3px 10px; font-size: 11px;
    border-radius: 12px; font-weight: 600; border: 1px solid transparent;
}
.badge-theory { border-color: #bfdbfe; color: #2563eb; background: #eff6ff; }
.badge-practice { border-color: #bbf7d0; color: #16a34a; background: #f0fdf4; }
.badge-challenge { border-color: #fed7aa; color: #ea580c; background: #fff7ed; }
.badge-python { border-color: #fde68a; color: #b45309; background: #fffbeb; }
.badge-scratch { border-color: #ddd6fe; color: #7c3aed; background: #f5f3ff; }
.badge-completed { border-color: #bbf7d0; color: #16a34a; background: #f0fdf4; }
.badge-in-progress { border-color: #bfdbfe; color: #2563eb; background: #eff6ff; }

/* ===== Table ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
    padding: 12px 14px; text-align: left;
    border-bottom: 1px solid #f3f4f6;
}
.table th { font-weight: 600; color: #9ca3af; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover td { background: #f9fafb; }

/* ===== Grid ===== */
.grid { display: grid; gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ===== Flex Utilities ===== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* ===== Spacing ===== */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ===== Text ===== */
.text-center { text-align: center; }
.text-muted { color: #9ca3af; }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.page-title { font-size: 26px; font-weight: 700; color: #111827; margin-bottom: 24px; }
.section-title { font-size: 16px; font-weight: 600; color: #374151; margin-bottom: 16px; }

/* ===== Auth Pages ===== */
.auth-container {
    min-height: calc(100vh - 60px);
    display: flex; align-items: center; justify-content: center;
}
.auth-card {
    width: 420px; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 16px; padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04);
}
.auth-title { font-size: 24px; font-weight: 700; color: #111827; text-align: center; margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: #9ca3af; text-align: center; margin-bottom: 32px; }
.auth-links { text-align: center; margin-top: 24px; font-size: 13px; color: #9ca3af; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 48px; color: #9ca3af; }
.empty-state-icon, .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state-text { font-size: 16px; margin-bottom: 16px; }

/* ===== Project Cards ===== */
.project-card { overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.project-thumbnail { height: 160px; overflow: hidden; background: #f3f4f6; }
.project-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.project-thumbnail-placeholder { display: flex; align-items: center; justify-content: center; font-size: 48px; background: #f9fafb; }
.code-textarea { font-family: 'Courier New', monospace; font-size: 14px; }

/* ===== Role Badge ===== */
.role-badge { font-size: 11px; padding: 3px 10px; border-radius: 12px; border: 1px solid #e5e7eb; color: #6b7280; background: #fff; }

/* ===== Footer ===== */
.footer {
    text-align: center; padding: 40px 24px 32px; color: #9ca3af;
    font-size: 12px; border-top: 1px solid #e5e7eb;
    margin-top: 40px; line-height: 1.8;
}
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-brand { font-size: 16px; font-weight: 700; color: #4a6cf7; margin-bottom: 4px; }
.footer-company { font-size: 13px; font-weight: 600; color: #6b7280; margin-bottom: 12px; }
.footer-info { color: #9ca3af; margin-bottom: 2px; }
.footer-sep { margin: 0 8px; color: #d1d5db; }
.footer-links { margin-top: 12px; margin-bottom: 12px; }
.footer-links a { color: #6b7280; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: #4a6cf7; }
.footer-privacy { font-weight: 700 !important; color: #374151 !important; }
.footer-privacy:hover { color: #4a6cf7 !important; }
.footer-copy { color: #b0b8c4; }

/* ===== JARVIS Spinner ===== */
.jarvis-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 99999; justify-content: center; align-items: center;
    flex-direction: column; gap: 16px;
}
.jarvis-overlay.active { display: flex; }
.jarvis-spinner {
    width: 80px; height: 80px; position: relative;
}
.jarvis-spinner .ring {
    position: absolute; border-radius: 50%;
    border: 2px solid transparent;
}
.jarvis-spinner .ring-1 {
    width: 80px; height: 80px; top: 0; left: 0;
    border-top-color: #4a6cf7; border-right-color: #4a6cf7;
    animation: jarvis-spin 1.2s linear infinite;
}
.jarvis-spinner .ring-2 {
    width: 60px; height: 60px; top: 10px; left: 10px;
    border-bottom-color: #22d3ee; border-left-color: #22d3ee;
    animation: jarvis-spin 1.8s linear infinite reverse;
}
.jarvis-spinner .ring-3 {
    width: 40px; height: 40px; top: 20px; left: 20px;
    border-top-color: #a78bfa; border-right-color: #a78bfa;
    animation: jarvis-spin 0.9s linear infinite;
}
.jarvis-spinner .core {
    position: absolute; width: 12px; height: 12px;
    top: 34px; left: 34px; border-radius: 50%;
    background: #4a6cf7;
    box-shadow: 0 0 12px rgba(74,108,247,0.6), 0 0 24px rgba(74,108,247,0.3);
    animation: jarvis-pulse 1.5s ease-in-out infinite;
}
.jarvis-text {
    font-size: 13px; font-weight: 600; color: #e2e8f0;
    letter-spacing: 3px; text-transform: uppercase;
}
@keyframes jarvis-spin {
    to { transform: rotate(360deg); }
}
@keyframes jarvis-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.7; }
}
