/* ============================================
   NURIINFRA Design System
   CSS Variables & Base Styles
============================================ */

:root {
    /* ==============================
       Colors - Dark Theme
    ============================== */
    
    /* Background Colors */
    --color-bg-primary: #030712;
    --color-bg-secondary: #0a0f1a;
    --color-bg-tertiary: #111827;
    --color-bg-input: #0f172a;
    --color-bg-elevated: #1e293b;
    --color-bg-card: rgba(17, 24, 39, 0.6);
    --color-bg-card-hover: rgba(30, 41, 59, 0.8);
    --color-bg-overlay: rgba(0, 0, 0, 0.7);

    /* Text Colors */
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-text-inverse: #030712;
    
    /* Accent Colors */
    --color-accent-cyan: #00d4ff;
    --color-accent-cyan-light: #67e8f9;
    --color-accent-cyan-dark: #0891b2;
    
    --color-accent-blue: #3b82f6;
    --color-accent-blue-light: #60a5fa;
    --color-accent-blue-dark: #1d4ed8;
    
    --color-accent-purple: #8b5cf6;
    --color-accent-purple-light: #a78bfa;
    --color-accent-purple-dark: #6d28d9;
    
    --color-accent-pink: #ec4899;
    
    /* Status Colors */
    --color-success: #22c55e;
    --color-success-light: #4ade80;
    --color-warning: #f59e0b;
    --color-warning-light: #fbbf24;
    --color-error: #ef4444;
    --color-error-light: #f87171;
    --color-info: #3b82f6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #3b82f6 50%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-glow: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    --gradient-radial: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    --gradient-text: linear-gradient(135deg, #00d4ff 0%, #3b82f6 50%, #8b5cf6 100%);
    /* 메인 페이지 및 공통 사용 그라디언트 */
    --gradient-accent: linear-gradient(90deg, var(--color-accent-cyan, #00d4ff), var(--color-accent-blue, #3b82f6));
    --gradient-card: linear-gradient(145deg, rgba(0, 212, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    
    /* Borders */
    --color-border-subtle: rgba(255, 255, 255, 0.06);
    --color-border-default: rgba(255, 255, 255, 0.1);
    --color-border-accent: rgba(0, 212, 255, 0.3);
    --color-border-focus: rgba(0, 212, 255, 0.5);
    --color-border-primary: #1e293b;
    --color-border-secondary: #334155;

    /* White (버튼 텍스트 등) */
    --color-white: #fff;

    /* 상태 배경색 (반투명) */
    --color-success-bg: rgba(34, 197, 94, 0.15);
    --color-error-bg: rgba(239, 68, 68, 0.15);
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-info-bg: rgba(59, 130, 246, 0.15);
    --color-purple-bg: rgba(168, 85, 247, 0.15);

    /* 에러 블록 (코드 diff 등) */
    --color-error-block-bg: #1c0f0f;
    --color-error-block-border: #7f1d1d;
    --color-error-block-text: #fca5a5;

    /* Text Extra */
    --color-text-light: #e2e8f0;
    --color-text-cyan: #06b6d4;

    /* ==============================
       Light Theme (관리자 콘텐츠 영역)
    ============================== */
    --color-content-bg: #ffffff;
    --color-content-bg-secondary: #f8fafc;
    --color-content-bg-hover: #f1f5f9;
    --color-content-border: #e2e8f0;
    --color-content-text: #1e293b;
    --color-content-text-secondary: #64748b;
    --color-content-text-muted: #94a3b8;
    --color-content-text-disabled: #cbd5e1;
    --color-content-shadow: rgba(0, 0, 0, 0.12);
    --color-content-active-bg: rgba(99, 102, 241, 0.06);
    --color-accent-blue-hover: #2563eb;
    --color-accent-indigo: #6366f1;
    --color-accent-teal: #14b8a6;

    /* ==============================
       Typography
    ============================== */
    
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* ==============================
       Spacing
    ============================== */
    
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */
    --space-32: 8rem;        /* 128px */
    
    /* ==============================
       Layout
    ============================== */
    
    --container-xs: 480px;
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
    
    --section-padding: clamp(80px, 12vw, 160px);
    --container-padding: clamp(20px, 5vw, 80px);
    
    /* ==============================
       Border Radius
    ============================== */
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-3xl: 24px;
    --radius-full: 9999px;
    
    /* ==============================
       Shadows
    ============================== */
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 60px rgba(0, 212, 255, 0.15);
    --shadow-glow-lg: 0 0 100px rgba(0, 212, 255, 0.2);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* ==============================
       Transitions
    ============================== */
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ==============================
       Z-Index
    ============================== */
    
    --z-negative: -1;
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-toast: 800;
}

/* ============================================
   Reset & Base
============================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================
   Typography Base
============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-6xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

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

a:hover {
    color: var(--color-accent-cyan-light);
}

strong, b {
    font-weight: var(--font-semibold);
}

small {
    font-size: var(--text-sm);
}

code, pre {
    font-family: var(--font-mono);
}

code {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
}

pre {
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

/* ============================================
   Lists
============================================ */

ul, ol {
    padding-left: var(--space-6);
    margin-bottom: var(--space-4);
}

li {
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
}

/* ============================================
   Images & Media
============================================ */

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

/* ============================================
   Forms Base
============================================ */

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid transparent;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--color-text-muted);
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

/* ============================================
   Tables Base
============================================ */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border-subtle);
}

th {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
}

/* ============================================
   Selection
============================================ */

::selection {
    background: var(--color-accent-cyan);
    color: var(--color-bg-primary);
}

/* ============================================
   Scrollbar
============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-border-default);
    border-radius: var(--radius-full);
}

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

/* ============================================
   Focus Visible
============================================ */

:focus-visible {
    outline: 2px solid var(--color-accent-cyan);
    outline-offset: 2px;
}

/* ============================================
   Utility Classes
============================================ */

/* Containers */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-2xl { max-width: var(--container-2xl); }

/* Section */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

/* Text Utilities */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-cyan); }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Spacing */
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Visibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn var(--transition-slow) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-slow) forwards; }
.animate-fade-in-down { animation: fadeInDown var(--transition-slow) forwards; }
.animate-scale-in { animation: scaleIn var(--transition-slow) forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* ============================================
   모션 감소 접근성 (Accessibility)
   전정기관 장애·동작 민감도를 가진 사용자를 위해
   운영체제 "모션 줄이기" 설정 시 애니메이션 비활성화
============================================ */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
