/* 
 * Ai강의사이트 Design System - Common
 * Concept: Friendly AI Tutor
 */

: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 */
/* Global Reset & Typography */
html {
    max-width: 100vw;
    /* height: 100%; removed to prevent scroll trapping */
}


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;
    max-width: 100vw;
    position: relative;
    /* height: 100%; removed */
    /* overflow-x: hidden; removed to rely on natural flow */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* 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-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
    background-color: var(--background-color);
    min-height: 100vh;
    padding-top: var(--header-height);
    /* overflow-x: hidden; removed */
}

.main-content {
    min-height: calc(100vh - var(--header-height) - 100px);
    padding: 0;
    /* overflow-x: hidden; removed */
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero Section - Full Width */
.hero-section {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.hero-section {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 768px) {
    .hero-section {
        margin-left: 0;
    }
}

/* Footer - Full Width */
.footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.footer {
    margin-left: var(--sidebar-collapsed-width);
}

@media (max-width: 768px) {
    .footer {
        margin-left: 0;
    }
}

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scrollbar Customization (Optional but good for premium feel) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Prevent horizontal scroll */
.container,
.container-fluid {
    max-width: 100%;
    /* overflow-x: hidden; removed unsafe */
}

.row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

.col,
[class*="col-"] {
    max-width: 100%;
    /* overflow-x: hidden; removed unsafe */
}

/* Mobile Responsive Common */
@media (max-width: 768px) {
    .main-content-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .main-content {
        padding: 0;
        max-width: 100%;
    }
}