/*
    =========================================================
    AUFTAKT LAB - PREMIUM HACKER WORKSPACE (ULTIMATE GLASS)
    =========================================================
    - Concept: Native Apple Glassmorphism + Minimalist Typography
    - Base: Pure Black (#000000)
    - Accents: Electric Cyan (Blue) & Terminal Neon (Green)
    - Architecture: Single Monolithic File
    =========================================================
*/

/* ---------------------------------------------------
   1. CORE VARIABLES & THEME
   --------------------------------------------------- */
:root {
    --abyss-bg: #000000;
    
    /* 🚀 유리창 투명도 극대화: 어두운 색을 빼고, 흰색 빛을 아주 얇게 1~3%만 줌 */
    --glass-bg-soft: rgba(255, 255, 255, 0.02);
    --border-glass: rgba(255, 255, 255, 0.08); /* 테두리 반사광은 살림 */
    --border-glass-hover: rgba(255, 255, 255, 0.2);

    --neon-blue: #0ea5e9; 
    --neon-blue-glow: rgba(14, 165, 233, 0.3);
    --neon-green: #10b981; 
    --neon-green-glow: rgba(16, 185, 129, 0.3);
    --neon-red: #f43f5e;

    --text-pure: #ffffff;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #475569;

    --shadow-abyss: 0 25px 50px -12px rgba(0, 0, 0, 1);
    --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ---------------------------------------------------
   2. TYPOGRAPHY (초딩 폰트 탈출 & 세련미 극대화)
   --------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Inter:wght@300;400;500;600&display=swap');

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--abyss-bg);
    color: var(--text-primary);
    /* 🚀 애플 디바이스 네이티브 폰트 최우선 적용 */
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 300; /* 전체 기본 굵기를 얇게 */
}

/* 터미널 폰트는 무조건 얇게 (300~400) */
.mono, .font-mono, code, pre {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-weight: 300;
}

/* 영문 대문자 타이틀은 자간을 넓혀야 세련돼 보임 */
h1, h2, h3, .uppercase {
    letter-spacing: 0.1em !important;
}

::selection {
    background: rgba(14, 165, 233, 0.3);
    color: var(--text-pure);
}

img {
    image-rendering: -webkit-optimize-contrast;
}

/* ---------------------------------------------------
   3. BACKGROUND & ATMOSPHERE
   --------------------------------------------------- */
body {
    position: relative;
    background-attachment: fixed;
}

/* 모눈종이 아주 연하게 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

/* 🚀 유리가 돋보이려면 배경 글로우가 조금 더 선명해야 함 (opacity 0.25로 상향) */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    background: url('../img/auftakt-grid-glow.svg') center/cover no-repeat;
    opacity: 0.25; 
    pointer-events: none;
}

/* ---------------------------------------------------
   4. PURE BLACK TERMINAL (터미널만 완전 까맣게!)
   --------------------------------------------------- */
#main-terminal-box {
    background-color: #000000 !important; 
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: 
        0 40px 80px rgba(0,0,0,1),
        inset 0 0 40px rgba(16, 185, 129, 0.03); 
    border-radius: 1.2rem;
    overflow: hidden;
}

#main-terminal-box > div:first-child {
    background-color: #030303 !important;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2) !important;
}

#main-terminal-box .bg-black\/40,
#main-terminal-box .p-6 {
    background-color: #000000 !important; 
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cursor, #terminal-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background-color: var(--neon-green);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

/* ---------------------------------------------------
   5. ULTIMATE TRANSPARENT GLASS (.glass & .ctf-card)
   --------------------------------------------------- */
.glass, .ctf-card {
    /* 🚀 핵심: 배경색은 거의 빼고 블러로만 승부 */
    background-color: var(--glass-bg-soft) !important;
    backdrop-filter: blur(48px) saturate(200%);
    -webkit-backdrop-filter: blur(48px) saturate(200%);
    border: 1px solid var(--border-glass);
    border-radius: 1.5rem;
    
    /* 유리 표면 굴절 효과 (inset 그림자 활용) */
    box-shadow: 
        var(--shadow-abyss),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2), 
        inset 0 0 20px rgba(255, 255, 255, 0.02);
        
    transition: all 0.5s var(--ease-apple);
    position: relative;
    overflow: hidden;
}

/* CTF 카드 전용 패턴 */
.ctf-card {
    background-image: url('../img/ctf-pattern.svg'); 
    background-position: right -20px bottom -20px;
    background-repeat: no-repeat;
    background-size: 50%; 
    background-blend-mode: color-dodge; /* 투명한 유리에 패턴이 예쁘게 스며들게 */
}

.glass:hover, .ctf-card:hover {
    transform: translateY(-4px) scale(1.005);
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--border-glass-hover);
    box-shadow: 
        0 40px 80px rgba(0, 0, 0, 1), 
        inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
}

/* ---------------------------------------------------
   6. NAVIGATION BAR
   --------------------------------------------------- */
nav, header {
    background: rgba(0, 0, 0, 0.2) !important; /* 거의 투명하게 */
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-bottom: 1px solid var(--border-glass) !important;
}

/* ---------------------------------------------------
   7. FORMS (Input, Textarea) - 얇고 세련되게!
   --------------------------------------------------- */
input, textarea, select {
    background: rgba(0, 0, 0, 0.3) !important; /* 폼 안쪽은 살짝 어둡게 */
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-pure) !important;
    transition: all 0.3s var(--ease-apple);
    border-radius: 0.5rem; 
    
    font-size: 0.9rem !important;
    font-weight: 300 !important; /* 글씨 얇게 */
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem !important; 
}

input:focus, textarea:focus {
    background: rgba(0, 0, 0, 0.6) !important;
    border-color: var(--neon-blue) !important;
    box-shadow: 0 0 0 1px var(--neon-blue) !important;
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary) !important;
    font-weight: 300 !important; 
}

/* ---------------------------------------------------
   8. BUTTONS
   --------------------------------------------------- */
button, .btn {
    transition: all 0.2s var(--ease-apple);
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase;
    border-radius: 0.5rem !important;
}

button:active { transform: scale(0.96); }

/* ---------------------------------------------------
   9. SCROLLBAR
   --------------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

/* ---------------------------------------------------
   10. TAILWIND ABSOLUTE OVERRIDES & TYPOGRAPHY FIX
   --------------------------------------------------- */
/* 🚀 기존의 칙칙한 색들을 투명한 유리로 강제 변환 */
.bg-slate-900, .bg-slate-950, .bg-black,
.bg-slate-800, .bg-slate-900\/50, .bg-slate-950\/50 {
    background-color: var(--glass-bg-soft) !important;
}

.border-slate-800, .border-slate-700, .border-slate-900,
.border-slate-800\/50, .border-slate-700\/50 {
    border-color: var(--border-glass) !important;
}

/* 텍스트 색상 및 글로우 엣지있게 */
.text-white { color: var(--text-pure) !important; }
.text-slate-200, .text-slate-300 { color: var(--text-primary) !important; }
.text-slate-400 { color: var(--text-secondary) !important; }
.text-slate-500, .text-slate-600 { color: var(--text-tertiary) !important; }

/* 🔵 Blue Accents */
.text-blue-400, .text-blue-500, .text-blue-600 {
    color: var(--neon-blue) !important;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}
.bg-blue-600, .bg-blue-500 {
    background: var(--neon-blue) !important;
    color: white !important;
}

/* 🟢 Green Accents */
.text-emerald-400, .text-emerald-500 {
    color: var(--neon-green) !important;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* 🔴 Red Accents */
.text-red-400, .text-red-500 { color: var(--neon-red) !important; }

/* 🚀 폰트 굵기(Weight) 억제 - 무식하게 굵은 거 다 빼버림 */
.font-black, .font-extrabold { font-weight: 600 !important; } 
.font-bold  { font-weight: 500 !important; } 
.font-semibold { font-weight: 400 !important; }

/* 🚀 타이포그래피 스케일 보정 (크기는 줄이고 자간은 조절) */
.text-5xl { font-size: 2rem !important; letter-spacing: 0.05em !important; }
.text-4xl { font-size: 1.6rem !important; letter-spacing: 0.05em !important; }
.text-3xl { font-size: 1.3rem !important; letter-spacing: 0.02em !important; }
.text-2xl { font-size: 1.15rem !important; letter-spacing: 0.01em !important; }
.text-lg { font-size: 0.95rem !important; font-weight: 300 !important; }
.text-base { font-size: 0.85rem !important; font-weight: 300 !important; }
.text-sm { font-size: 0.8rem !important; font-weight: 300 !important; }
.text-xs { font-size: 0.7rem !important; font-weight: 300 !important; letter-spacing: 0.05em !important; }

tr { transition: background-color 0.2s; }
tr:hover { background-color: rgba(255, 255, 255, 0.03) !important; }