/**
 * KAITRUST Common CSS
 * 모든 서브사이트가 공유하는 헤더/푸터/공통 스타일
 * @version 1.0.0
 */

/* ========== CSS Variables ========== */
:root {
    --primary: #00f5ff;
    --secondary: #ff6b35;
    --accent: #a855f7;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0a0a0f;
    --darker: #050508;
    --card-bg: rgba(15, 23, 42, 0.8);
    --glow: 0 0 20px rgba(0, 245, 255, 0.3);
    --font-main: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Orbitron', monospace;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--darker);
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ========== Animated Background ========== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 245, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 107, 53, 0.04) 0%, transparent 70%);
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(0, 245, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 25s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ========== Header ========== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.2);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 2px;
}

/* Navigation */
nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    font-weight: 500;
}

nav a:hover {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

nav a:hover::after {
    width: 100%;
}

/* Highlight buttons */
nav a.nav-highlight {
    color: var(--warning);
    border: 1px solid var(--warning);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 1rem;
}

nav a.nav-highlight:hover {
    background: var(--warning);
    color: var(--dark);
}

nav a.nav-highlight::after {
    display: none;
}

nav a.nav-glossary {
    color: var(--primary);
    border-color: var(--primary);
}

nav a.nav-glossary:hover {
    background: var(--primary);
    color: var(--dark);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #94a3b8;
    text-decoration: none;
}

.nav-dropdown-trigger:hover {
    color: var(--primary);
}

.dropdown-arrow {
    font-size: 0.7em;
    transition: transform 0.3s;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 8px;
    min-width: 160px;
    padding: 8px 0;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
    animation: fadeInDropdown 0.2s ease;
}

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

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover {
    background: rgba(0, 245, 255, 0.2);
    color: var(--primary);
    padding-left: 24px;
}

/* External link */
/* 컨설팅 신청 */
.nav-consulting {
    color: #10b981 !important;
}
.nav-consulting:hover {
    color: #34d399 !important;
}

.nav-external {
    color: #a855f7 !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-external:hover {
    color: #c084fc !important;
}

.external-icon {
    font-size: 0.8em;
    transition: transform 0.2s;
}

.nav-external:hover .external-icon {
    transform: translate(2px, -2px);
}

/* Login button */
.nav-login {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    padding: 8px 16px !important;
    border-radius: 6px;
    color: white !important;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-login:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.nav-login::after {
    display: none !important;
}

/* Language button */
.nav-lang {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s;
}

.nav-lang:hover {
    border-color: rgba(0, 245, 255, 0.5);
    background: rgba(0, 245, 255, 0.1);
}

/* ========== Mobile Navigation ========== */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ========== Footer ========== */
footer {
    background: rgba(5, 5, 8, 0.98);
    border-top: 1px solid rgba(0, 245, 255, 0.2);
    padding: 4rem 2rem 2rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #64748b;
    line-height: 1.8;
}

.footer-section h4 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-info {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-info strong {
    color: #94a3b8;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    color: #64748b;
    font-size: 0.9rem;
}

.footer-bottom .highlight {
    color: var(--primary);
    font-weight: 600;
}

/* ========== Common Components ========== */

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--dark);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 50px rgba(0, 245, 255, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(0, 245, 255, 0.5);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(0, 245, 255, 0.1);
    border-color: var(--primary);
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}

.card:hover {
    border-color: rgba(0, 245, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 212, 255, 0.15);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-live {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-coming {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-new {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Section title */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title p {
    color: #64748b;
}

/* Fade in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    header {
        padding: 1rem 1.5rem;
    }

    nav {
        gap: 1rem;
    }

    nav a.nav-highlight {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .logo-sub {
        display: none;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }
}

/* ========== Utility Classes ========== */
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: #64748b !important; }

.bg-primary { background: var(--primary) !important; }
.bg-accent { background: var(--accent) !important; }
.bg-dark { background: var(--dark) !important; }

.font-display { font-family: var(--font-display) !important; }
.font-mono { font-family: var(--font-mono) !important; }

.glow { box-shadow: var(--glow); }

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 245, 255, 0.5);
}

/* ========== Selection ========== */
::selection {
    background: rgba(0, 245, 255, 0.3);
    color: #fff;
}
