@charset "utf-8";

/* =========================================================================
   1. Core variables & Theming (첨부된 Grok 이미지 디자인 반영)
   ========================================================================= */
:root {
    /* Base Colors (Grok의 deep grey/black 룩) */
    --bg-base: #0a0a0c; /* Deepest black background */
    --bg-card: #151518; /* Slightly lighter deep grey for cards/sidebar */
    --text-base: #e1e1e6; /* Bright but soft light grey text */
    --text-muted: #8b8b93; /* Muted text for descriptions */

    /* Accent & Action Colors (Grok의 Blue/Purple accent) */
    --accent-blue: #3498db; /* Primary blue for links/headers */
    --accent-success: #2ecc71; /* Green for checkmarks/success */
    --accent-danger: #e74c3c; /* Red for delete/errors */
    --accent-hover-blue: #2c3e50; /* Hover state background */

    /* Modal / Overlay */
    --overlay-bg: rgba(0, 0, 0, 0.7); /* Deep dark overlay */
}

/* Light Theme Variables */
body.light-theme {
    --bg-base: #f8f9fa;
    --bg-card: #ffffff;
    --text-base: #333333;
    --text-muted: #666666;
    --accent-blue: #007bff;
    --accent-hover-blue: #e9ecef;
    --overlay-bg: rgba(255, 255, 255, 0.7);
}

/* =========================================================================
   2. Base Styles
   ========================================================================= */
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', 'Roboto', 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-base);
    color: var(--text-base);
    font-size: 14px;
}

/* =========================================================================
   3. Main Layout (Sidebar)
   ========================================================================= */
.wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-card);
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
}
.sidebar .logo {
    text-align: center;
    margin-bottom: 40px;
    color: var(--accent-blue);
    font-size: 20px;
    font-weight: bold;
}
.sidebar .nav-item {
    padding: 12px 15px;
    color: var(--text-base);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: background-color 0.3s;
}
.sidebar .nav-item:hover, .sidebar .nav-item.active {
    background-color: var(--accent-hover-blue);
    color: var(--accent-blue);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Header Bar */
.top-header {
    height: 60px;
    background-color: var(--bg-card);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}
.top-header h2 { margin: 0; font-size: 18px; color: var(--accent-blue); }

/* User Profile & Theme Switcher (Top Right) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.theme-switcher select {
    background: transparent;
    color: var(--text-base);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 5px;
    font-size: 12px;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-profile .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #9b59b6; /* 첨부 이미지의 퍼플 색상 */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Content Body */
.content-body { flex: 1; padding: 30px; }

/* =========================================================================
   4. UI Components (첨부 이미지의 clean card-based layout 반영)
   ========================================================================= */
/* Clean Card-based Layout */
.data-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Header & Muted Text (Grok card design) */
.grok-header { margin-bottom: 15px; }
.grok-header h3 { margin: 0; color: var(--accent-blue); }
.grok-header .grok-info { color: var(--text-muted); font-size: 13px; margin-top: 5px; }

/* Clean Table (Available models table design) */
table.grok-tbl {
    width: 100%;
    border-collapse: collapse;
}
table.grok-tbl th, table.grok-tbl td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
table.grok-tbl th { color: var(--text-muted); font-size: 12px; font-weight: normal; }
table.grok-tbl tr:hover { background-color: var(--accent-hover-blue); }

/* Form Styles */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: 13px; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--text-base);
}

/* Grok-style Button (Purple accent) */
.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    background-color: #9b59b6; /* Grok Purple */
    color: #fff;
    transition: background-color 0.3s;
}
.btn:hover { background-color: #8e44ad; }
.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }
.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }

/* =========================================================================
   5. Modern Overlays (Modal & Spinner)
   ========================================================================= */
/* Modern Confirmation Modal */
.wookly-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--overlay-bg);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
}
.wookly-modal {
    background-color: var(--bg-card);
    border-radius: 10px;
    width: 400px;
    padding: 30px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}
.wookly-modal h4 { color: var(--accent-danger); margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 25px; }

/* Full-screen Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--overlay-bg);
    display: none;
    align-items: center; justify-content: center;
    z-index: 2000;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #9b59b6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }