/* =============================================
   TAEON Viral Portal - Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --primary: #6C2BD9;
    --primary-light: #8B5CF6;
    --primary-dark: #5521B5;
    --primary-50: #F5F0FF;
    --primary-100: #EDE5FF;
    
    --accent: #BFFF00;
    --accent-dark: #9ACD00;
    
    --black: #0A0A0A;
    --white: #FFFFFF;
    
    /* Neutrals */
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Outfit', 'Noto Sans KR', -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* =============================================
   LAYOUT
   ============================================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--black);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-logo {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-brand-text small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--gray-400);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-300);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--black);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.sidebar-user:hover { background: rgba(255,255,255,0.06); }

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--white);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.content-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.content-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-body {
    padding: 28px 32px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 24px; }
.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px 24px;
    transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
    overflow-x: auto;
}

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

table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
    background: var(--gray-50);
}

table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

table tbody tr {
    transition: background 0.15s;
}

table tbody tr:hover {
    background: var(--primary-50);
}

/* =============================================
   STATUS BADGES
   ============================================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Tailwind-like utility classes for badges */
.bg-gray-100 { background: var(--gray-100); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-600 { color: var(--gray-600); }
.bg-blue-100 { background: #DBEAFE; }
.text-blue-700 { color: #1D4ED8; }
.bg-amber-100 { background: #FEF3C7; }
.text-amber-700 { color: #B45309; }
.bg-emerald-100 { background: #D1FAE5; }
.text-emerald-700 { color: #047857; }
.bg-red-100 { background: #FEE2E2; }
.text-red-700 { color: #B91C1C; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }

.btn-accent {
    background: var(--accent);
    color: var(--black);
}
.btn-accent:hover { background: var(--accent-dark); }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); }

.btn-danger {
    background: var(--danger);
    color: var(--white);
}
.btn-danger:hover { background: #DC2626; color: var(--white); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-icon {
    padding: 8px;
    border-radius: var(--radius-xs);
}

.btn-group { display: flex; gap: 8px; }

/* =============================================
   FORMS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-textarea { min-height: 100px; resize: vertical; }
.form-hint {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* =============================================
   COPY URL
   ============================================= */
.url-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.url-text {
    font-size: 12px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    color: var(--primary);
    background: var(--primary-50);
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    padding: 4px 8px;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xs);
    cursor: pointer;
    color: var(--gray-500);
    font-size: 11px;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-copy.copied {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

/* =============================================
   CONTENT CARDS (Visual list)
   ============================================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.content-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.content-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.content-card-thumb {
    width: 100%;
    height: 180px;
    background: var(--gray-100);
    object-fit: cover;
    display: block;
}

.content-card-body {
    padding: 16px;
}

.content-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.content-card-platform {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.content-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    font-size: 20px;
}

/* =============================================
   CLAIM THREAD
   ============================================= */
.claim-thread {
    border-left: 3px solid var(--primary-100);
    padding-left: 20px;
    margin: 16px 0;
}

.claim-message {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 12px;
}

.claim-message.admin-reply {
    background: var(--primary-50);
    border-left: 3px solid var(--primary);
}

.claim-message-meta {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.claim-message-text {
    font-size: 13px;
    color: var(--gray-800);
    line-height: 1.7;
}

/* =============================================
   FILTERS & TABS
   ============================================= */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.filter-tab {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: all 0.2s;
}

.filter-tab.active {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary);
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

/* =============================================
   TOAST
   ============================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--gray-900);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(108,43,217,0.15), transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(191,255,0,0.08), transparent 50%);
    animation: login-bg 20s ease-in-out infinite alternate;
}

@keyframes login-bg {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, 3%); }
}

.login-card {
    position: relative;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(20px);
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: var(--white);
    margin-bottom: 16px;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
}

.login-brand p {
    font-size: 13px;
    color: var(--gray-500);
}

.login-form .form-label {
    color: var(--gray-400);
}

.login-form .form-input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: var(--white);
}

.login-form .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,43,217,0.2);
}

.login-form .form-input::placeholder {
    color: var(--gray-600);
}

.login-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-top: 8px;
}

.login-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #FCA5A5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13px;
    max-width: 300px;
    margin: 0 auto;
}

/* =============================================
   RESPONSIVE
   ============================================= */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
    .content-body {
        padding: 20px 16px;
    }
    .content-header {
        padding: 0 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* =============================================
   UTILITIES
   ============================================= */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
