/* 
 * Ai강의사이트 Design System
 * Concept: Friendly AI Tutor
 */

/* Login/Register Page Styles */
.login-container {
    max-width: 500px;
    margin: 5rem auto;
    padding: 0 1rem;
}

.login-container .card {
    border: none;
    box-shadow: var(--shadow-lg);
}

.login-container .card-title {
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

:root {
    /* Color Palette */
    --primary-color: #4F46E5;
    /* Indigo */
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    /* Emerald */
    --background-color: #F3F4F6;
    /* Cool Gray 100 */
    --surface-color: #FFFFFF;
    --text-primary: #1F2937;
    /* Cool Gray 800 */
    --text-secondary: #6B7280;
    /* Cool Gray 500 */
    --border-color: #E5E7EB;
    /* Cool Gray 200 */

    /* Spacing & Sizing */
    --header-height: 60px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;

    /* 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Global Reset & Typography */
body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans KR", sans-serif;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Header (Offset by Sidebar) */
.main-header {
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    z-index: 1020;
    box-shadow: var(--shadow-sm);
    transition: left 0.3s ease, width 0.3s ease;
}

@media (min-width: 769px) {
    .sidebar.collapsed~.main-header {
        left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }
}

/* Navbar Customization (Legacy support or modify if still used inside) */
/* ... but we are replacing navbar with .main-header mostly */

/* Buttons */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    transition: transform 0.1s, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.4);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--surface-color);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card.no-hover:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.card-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Layout Content */
.main-content {
    min-height: calc(100vh - var(--header-height) - 100px);
    padding: 1.5rem 0;
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
}

/* Guide Content Styling */
.guide-content {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.guide-content h2 {
    color: var(--primary-color);
    border-bottom: 2px solid #E0E7FF;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.guide-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-content h3::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background-color: var(--secondary-color);
    border-radius: 4px;
}

.guide-content pre,
.guide-content code {
    background-color: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: #E11D48;
    /* Code Pink */
}

.guide-content pre {
    padding: 1.5rem;
    color: var(--text-primary);
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: end;
    gap: 10px;
}

.fab-main-btn {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.fab-main-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

.fab-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
}

/* Sidebar Layout */
body {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 0;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    transition: width 0.3s ease;
    border-right: 1px solid var(--border-color);
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
}

/* Desktop Sidebar Collapsed State */
.main-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    width: 100%;
    background-color: var(--background-color);
    min-height: 100vh;
    padding-top: var(--header-height);
}

@media (min-width: 769px) {
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar.collapsed .sidebar-text {
        display: none;
    }

    .sidebar.collapsed .logo-area {
        display: none !important;
    }

    .sidebar.collapsed .sidebar-header {
        justify-content: center !important;
    }

    .sidebar.collapsed #sidebarToggle {
        margin: 0 !important;
    }

    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.collapsed .nav-link i {
        margin-right: 0 !important;
        font-size: 1.2rem;
    }

    .sidebar.collapsed .btn {
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
    }

    .sidebar.collapsed .btn i {
        margin-right: 0 !important;
    }

    .sidebar.collapsed .dropdown-toggle {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.collapsed .dropdown-toggle::after {
        display: none;
    }

    .sidebar.collapsed~.main-content-wrapper {
        margin-left: var(--sidebar-collapsed-width);
    }
}

/* Mobile Sidebar */
@media (max-width: 768px) {
    .main-header {
        left: 0;
        width: 100%;
    }

    .main-content-wrapper {
        margin-left: 0;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

/* Nav Link Styling in Sidebar */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: #EEF2FF;
}

.sidebar .nav-link i {
    font-size: 1.25rem;
}

/* Mobile Header/Content Adjustments */
.mobile-header {
    display: none;
    /* We use main-header now? Wait, if sidebar covers everything, we need a toggle. 
                          But user said hamburger in sidebar. 
                          If sidebar is off-canvas, how do we open it?
                          We typically need a mobile top bar or a floating toggle.
                          For now, assume user accepts standard behavior or I'll add a mobile toggle to header?
                          The user specifically said "Hamburger button also in sidebar".
                          I will rely on the sidebar logic provided. */
}


.fab-container:hover .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    background-color: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
    text-decoration: none;
}

.fab-item:hover {
    background-color: #F3F4F6;
    color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand span {
        display: none;
        /* Hide text on small screens if too cramped, optional */
    }

    .guide-content {
        padding: 1.5rem;
    }
}

/* Quiz UI Styles */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Quiz Page Layout Optimization */
.quiz-page-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quiz-card {
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    border: 1px solid transparent;
    cursor: pointer;
    overflow: hidden;
}

.quiz-card .card-body {
    padding: 2rem !important;
    /* Reduce padding to fit content */
}

.quiz-icon-wrapper {
    width: 80px;
    /* Reduce size */
    height: 80px;
    /* Reduce size */
    margin-bottom: 1rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.quiz-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem !important;
}

.quiz-card p {
    font-size: 0.9rem;
    margin-bottom: 1rem !important;
}

.quiz-card .btn {
    padding: 0.375rem 1.5rem;
    font-size: 0.9rem;
    margin-top: 0 !important;
}

.quiz-card:hover .quiz-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* AI Guide Roadmap Styles */
.roadmap-container {
    position: relative;
    padding: 4rem 0 4rem;
    /* Increased top padding to move it down */
    margin-top: 2rem;
    /* Added margin for extra spacing */
    display: flex;
    /* Flex to help centering if needed */
    flex-direction: column;
    justify-content: center;
}

.roadmap-step {
    flex: 1;
    position: relative;
    z-index: 1;
}

.roadmap-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.roadmap-card:hover,
.roadmap-card.active {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.roadmap-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.roadmap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 2rem;
}

@media (max-width: 768px) {
    .roadmap-arrow {
        transform: rotate(90deg);
        margin: 1rem 0;
    }
}

.quiz-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.review-card .card-title {
    color: var(--text-secondary);
}

.review-card:hover {
    border-color: rgba(107, 114, 128, 0.2);
}

/* Profile Modal Styles */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.profile-modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Home Page Buttons */
.home-action-btn {
    width: 220px;
    display: inline-block;
    /* margin: 0 auto; Removed for left alignment */
}

/* OX Quiz Specific Styles */
.ox-btn {
    transition: transform 0.1s, box-shadow 0.2s;
    border-width: 3px;
}

.ox-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.ox-btn:active {
    transform: scale(0.95);
}

.quiz-diff-btn {
    min-width: 150px;
    transition: transform 0.2s;
}

.quiz-diff-btn:hover {
    transform: translateY(-5px);
}