/* ====================================================
   AI Engines - 메인 스타일시트
   ==================================================== */

/* --- CSS 변수 --- */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg-base: #f8fafc;
    --bg-card: #ffffff;
    --bg-muted: #f1f5f9;

    --text-main: #0f172a;
    --text-sub: #334155;
    --text-muted: #64748b;

    --border: #e2e8f0;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .07), 0 2px 4px -1px rgba(0, 0, 0, .04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .07), 0 4px 6px -2px rgba(0, 0, 0, .04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .08), 0 10px 10px -5px rgba(0, 0, 0, .04);

    --font: 'Pretendard', 'Apple SD Gothic Neo', 'Nanum Gothic', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: .2s cubic-bezier(.4, 0, .2, 1);
}

/* --- 기본 초기화 --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 17px;
}

body {
    font-family: var(--font);
    color: var(--text-main);
    background: var(--bg-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-sub {
    color: var(--text-sub) !important;
}

/* --- 스크롤바 --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ====================================================
   네비게이션
   ==================================================== */
#mainNavbar {
    padding: .6rem 0;
    background: rgba(255, 255, 255, .95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    z-index: 1030;
}

#mainNavbar.scrolled {
    box-shadow: var(--shadow);
}

.logo-img {
    border-radius: 6px;
    transition: transform var(--transition);
}

.navbar-brand:hover .logo-img {
    transform: rotate(-5deg) scale(1.05);
}

.brand-text {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--text-main);
}

.navbar .nav-link {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-sub) !important;
    padding: .4rem .8rem !important;
    border-radius: 6px;
    transition: background var(--transition), color var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary) !important;
    background: rgba(37, 99, 235, .06);
}

.navbar .btn-sm {
    font-size: .78rem;
    padding: .35rem .85rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition);
}

/* ====================================================
   히어로 섹션
   ==================================================== */
.hero-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 40%, #f0f7ff 100%);
    padding: 60px 0 40px;
    position: relative;
    overflow: hidden;
}

@media (min-width: 1200px) {
    .hero-section .container {
        max-width: 1200px;
    }
}

@media (min-width: 1400px) {
    .hero-section .container {
        max-width: 1140px;
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, .08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, .06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(37, 99, 235, .1);
    color: var(--primary);
    font-size: .75rem;
    font-weight: 600;
    padding: .35rem .9rem;
    border-radius: 20px;
    margin-bottom: 1.2rem;
    letter-spacing: .5px;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(1.3);
    }
}

.hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.5px;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: .95rem;
    color: var(--text-sub);
    max-width: 520px;
    line-height: 1.75;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat .num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.hero-stat .label {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-logo-wrap {
    position: relative;
    width: 200px;
    height: 200px;
}

.hero-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 20px 40px rgba(37, 99, 235, .2));
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.hero-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, .12);
    animation: spin-ring linear infinite;
}

.hero-ring:nth-child(2) {
    inset: -20px;
    animation-duration: 12s;
}

.hero-ring:nth-child(3) {
    inset: -40px;
    animation-duration: 20s;
    animation-direction: reverse;
    border-color: rgba(16, 185, 129, .1);
}

@keyframes spin-ring {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Dashboard Mockup --- */
.dashboard-mockup {
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform var(--transition);
    max-width: 520px;
    width: 100%;
}

.dashboard-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.glass-card {
    transition: transform var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.animate-float {
    animation: float-soft 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-soft 4s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes float-soft {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.text-xs {
    font-size: 0.7rem;
}

.leading-none {
    line-height: 1;
}

.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* ====================================================
   섹션 공통
   ==================================================== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(37, 99, 235, .08);
    padding: .3rem .8rem;
    border-radius: 20px;
    margin-bottom: .8rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text-main);
    margin-bottom: .6rem;
}

.section-desc {
    font-size: .9rem;
    color: var(--text-sub);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ====================================================
   API 카드
   ==================================================== */
.apis-section {
    padding: 50px 0;
    background: #fff;
}

.api-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity var(--transition);
}

.api-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, .2);
    color: inherit;
}

.api-card:hover::before {
    opacity: 1;
}

.api-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    transition: transform var(--transition);
}

.api-card:hover .api-icon-wrap {
    transform: scale(1.1) rotate(-3deg);
}

.api-card-name {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .4rem;
    color: var(--text-main);
}

.api-card-desc {
    font-size: .82rem;
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: .8rem;
}

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

.api-card-category {
    font-size: .7rem;
    color: var(--text-muted);
}

.api-arrow {
    color: var(--primary);
    font-size: .8rem;
    opacity: 0;
    transform: translateX(-4px);
    transition: all var(--transition);
}

.api-card:hover .api-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ====================================================
   서비스 섹션
   ==================================================== */
.services-section {
    padding: 50px 0;
    background: var(--bg-base);
}

.service-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.5rem;
    height: 100%;
    transition: all var(--transition);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a.service-card {
    cursor: pointer;
}

a.service-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, .15);
}

.service-icon-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(124, 58, 237, .08));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary);
    margin: 0 auto 1rem;
    transition: all var(--transition);
}

a.service-card:hover .service-icon-circle {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    transform: scale(1.1);
}

.service-name {
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: .4rem;
    color: var(--text-main);
}

.service-desc {
    font-size: .82rem;
    color: var(--text-sub);
    line-height: 1.6;
}

.service-url {
    font-size: .75rem;
    color: var(--primary);
    background: rgba(37, 99, 235, .08);
    padding: .35rem .85rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition);
    max-width: 100%;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    border: 1px solid transparent;
}

a.service-card:hover .service-url {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary);
}

/* ====================================================
   CTA 섹션
   ==================================================== */
.cta-section {
    padding: 50px 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary), #7c3aed);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: .8rem;
}

.cta-desc {
    font-size: .88rem;
    color: rgba(255, 255, 255, .8);
    margin-bottom: 2rem;
}

/* ====================================================
   카드 공통
   ==================================================== */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 1.5rem;
}

/* ====================================================
   폼
   ==================================================== */
.form-control,
.form-select {
    font-size: .82rem;
    border-radius: 8px;
    border-color: var(--border);
    padding: .6rem .9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: .4rem;
}

/* --- 입력 그룹 커스텀 --- */
.input-group-text {
    background-color: var(--bg-base);
    border-color: var(--border);
    color: var(--text-muted);
    font-size: .82rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

.btn-password-toggle {
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding-left: 1rem;
    padding-right: 1rem;
    transition: all var(--transition);
}

.btn-password-toggle:hover {
    background-color: var(--bg-muted);
    color: var(--primary);
}

.btn-password-toggle:focus {
    box-shadow: none;
    border-color: var(--border);
}

/* 포커스 시 테두리 색상 동기화 */
.input-group:focus-within .input-group-text,
.input-group:focus-within .btn-password-toggle {
    border-color: var(--primary);
}

/* --- 버튼 공통 --- */

/* ====================================================
   버튼
   ==================================================== */
.btn {
    font-size: .82rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}

.btn-lg {
    font-size: .9rem;
    padding: .75rem 1.8rem;
    border-radius: 10px;
}

/* ====================================================
   badges
   ==================================================== */
.badge {
    font-size: .68rem;
    font-weight: 600;
    padding: .3em .65em;
    border-radius: 6px;
}

/* ====================================================
   인증 페이지
   ==================================================== */
.auth-page {
    min-height: calc(100vh - 57px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    padding: 2rem 0;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.8rem;
}

.auth-logo img {
    width: 52px;
    height: 52px;
    margin-bottom: .6rem;
}

.auth-logo h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: .3rem;
}

.auth-sub {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ====================================================
   마이페이지 / 관리자
   ==================================================== */
.page-header {
    background: linear-gradient(135deg, #f0f7ff, #fff);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-label {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

/* ====================================================
   API 상세 페이지
   ==================================================== */
.api-detail-header {
    background: linear-gradient(135deg, #f0f7ff, #fff);
    padding: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--border);
}

.api-detail-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.guide-content {
    font-size: .88rem;
    line-height: 1.8;
    color: var(--text-main);
    background: #fcfdfe;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, .08);
}

.guide-content h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: .6rem;
}

.guide-content h2::before {
    content: '';
    width: 6px;
    height: 1.2rem;
    background: var(--primary);
    border-radius: 4px;
}

.guide-content h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 1.8rem;
    margin-bottom: .8rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
    padding-bottom: .4rem;
}

.guide-content pre {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 1.2rem;
    margin: 1.2rem 0;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.guide-content pre::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 12px;
    width: 32px;
    height: 8px;
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
    box-shadow: 1.5rem 0 rgba(255, 255, 255, .1), 3rem 0 rgba(255, 255, 255, .1);
}

.guide-content code {
    background: rgba(37, 99, 235, .08);
    color: var(--primary);
    padding: .2em .4em;
    border-radius: 4px;
    font-size: .9em;
    font-family: var(--font-mono);
    font-weight: 600;
}

.guide-content .table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .02);
}

.guide-content .table {
    margin-bottom: 0;
    font-size: .82rem;
}

.guide-content .table thead th {
    background: #f8fafc;
    color: var(--text-dark);
    font-weight: 700;
    padding: .8rem;
    border-bottom: 1px solid var(--border);
}

.guide-content .table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.guide-content .table td {
    padding: .75rem .8rem;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
}

.guide-content .table tr:last-child td {
    border-bottom: none;
}

.guide-content .table td strong {
    font-family: var(--font-mono);
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    padding: .15rem .5rem;
    border-radius: 4px;
    font-weight: 600;
}

.guide-content code {
    background: var(--bg-muted);
    color: var(--primary);
    padding: .2em .4em;
    border-radius: 4px;
    font-size: .9em;
    font-family: var(--font-mono);
    font-weight: 500;
}

.guide-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-weight: 400;
}

/* 마크다운 테이블 스타일 */
.guide-content .table-responsive {
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.guide-content .table {
    margin-bottom: 0;
    font-size: .82rem;
}

.guide-content .table thead th {
    background: #f8fafc;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border);
}

.guide-content .table td {
    padding: .75rem;
    color: var(--text-sub);
}

.guide-content .table td strong {
    display: inline-block;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
    padding: .15rem .5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.guide-content ul,
.guide-content ol {
    margin-bottom: 1.2rem;
}

.guide-content li {
    margin-bottom: .4rem;
}


/* ====================================================
   테이블
   ==================================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    font-size: .9rem;
}

.table th {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom-width: 1px;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

/* ====================================================
   알림
   ==================================================== */
.alert {
    font-size: .82rem;
    border-radius: 10px;
    border: none;
}

/* ====================================================
   푸터 링크
   ==================================================== */
.footer-links {
    margin: 0;
}

.footer-links li {
    margin-bottom: .4rem;
}

.footer-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-size: .8rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer {
    font-size: .82rem;
}

/* ====================================================
   진행률 표시줄
   ==================================================== */
.progress {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-muted);
}

.progress-bar {
    border-radius: 3px;
    transition: width 1s ease;
}

/* ====================================================
   사이드바 (관리자/마이페이지)
   ==================================================== */
.sidebar {
    background: #fff;
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 57px);
    padding: 1.5rem 1rem;
}

.sidebar-nav .nav-link {
    font-size: .82rem;
    color: var(--text-sub);
    padding: .5rem .8rem;
    border-radius: 8px;
    margin-bottom: .2rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(37, 99, 235, .08);
    color: var(--primary);
}

.sidebar-nav .nav-link i {
    font-size: .95rem;
    width: 18px;
    text-align: center;
}

/* ====================================================
   API Key 박스
   ==================================================== */
.api-key-box {
    background: #1e293b;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: .78rem;
    padding: .8rem 1rem;
    border-radius: 8px;
    word-break: break-all;
    position: relative;
}

.api-key-value {
    color: #7dd3fc;
    user-select: all;
}

/* ====================================================
   토스트
   ==================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
}

/* ====================================================
   애니메이션 헬퍼
   ==================================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================================
   반응형
   ==================================================== */
@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .hero-section {
        padding: 50px 0 40px;
    }

    .hero-visual {
        margin-top: 2rem;
    }

    .hero-logo-wrap {
        width: 140px;
        height: 140px;
    }

    .apis-section,
    .services-section,
    .cta-section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .auth-card {
        padding: 1.8rem;
        margin: 0 1rem;
    }

    .sidebar {
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-stats {
        gap: 1.2rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }
}

/* ====================================================
   유틸리티
   ==================================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-primary-subtle {
    background: rgba(37, 99, 235, .08) !important;
}

.bg-success-subtle {
    background: rgba(16, 185, 129, .08) !important;
}

.bg-warning-subtle {
    background: rgba(245, 158, 11, .08) !important;
}

.bg-danger-subtle {
    background: rgba(239, 68, 68, .08) !important;
}

.bg-info-subtle {
    background: rgba(6, 182, 212, .08) !important;
}

.bg-secondary-subtle {
    background: rgba(100, 116, 139, .08) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.rounded-xl {
    border-radius: var(--radius-lg) !important;
}

.shadow-soft {
    box-shadow: var(--shadow) !important;
}

/* 로딩 스피너 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: .15em;
}

/* 코드 하이라이트 */
pre {
    margin: 0;
}

/* 스켈레톤 */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ====================================================
   코드 블록 (Highlight.js + Copy Button)
   ==================================================== */
.code-wrapper {
    position: relative;
    margin: 1rem 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1e1e1e;
    /* Highlight.js theme background */
}

.code-wrapper pre {
    margin: 0 !important;
    padding: 1.25rem 1rem !important;
    font-size: .82rem;
    color: #e2e8f0;
    font-family: var(--font-mono);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.btn-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    font-size: .75rem;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-copy:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-copy.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.guide-content pre code {
    font-family: var(--font-mono);
    line-height: 1.5;
}
 
/* 가이드 콘텐츠 전용 스타일 */
.guide-content {
    font-size: .88rem;
    line-height: 1.7;
    color: var(--text-sub);
}
 
.guide-h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    border-bottom: 2px solid var(--border);
    padding-bottom: .5rem;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}
 
.guide-h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 1.5rem !important;
    margin-bottom: .75rem !important;
}
 
.guide-content ul {
    padding-left: 1.25rem !important;
    margin-bottom: 1.5rem !important;
    list-style-type: disc;
}
 
.guide-content li {
    margin-bottom: .35rem !important;
}
 
.guide-content li strong {
    color: var(--text-main);
}
 
.guide-content .table-responsive {
    margin: 1.5rem 0;
}
 
.guide-content table th {
    background-color: var(--bg-muted);
    font-size: .8rem;
    white-space: nowrap;
}
 
.guide-content table td {
    font-size: .82rem;
}