/**
 * Thorts Marketing - 공통 스타일
 */

/* Reset & Variables */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #050508;
    --card: #0f0f16;
    --border: #1a1a28;
    --txt: #a8a8b8;
    --txt-bright: #ffffff;
    --muted: #6b6b80;
    --accent: #ec4899;
    --accent-light: #f472b6;
    --accent-glow: rgba(236, 72, 153, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--txt);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* Typography */
h1, h2, h3, h4 { color: var(--txt-bright); font-weight: 700; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 12px;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    z-index: 1000;
}

.main {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    min-height: 100vh;
}

/* Logo */
.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--txt-bright);
    padding: 0 12px 24px;
}
.logo span { color: var(--accent); }

/* Navigation */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--txt);
    margin-bottom: 4px;
    transition: all 0.2s;
}
.nav-item:hover { background: var(--bg); color: var(--txt-bright); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); }
.nav-divider { height: 1px; background: var(--border); margin: 16px 0; }

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--txt-bright); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary { background: var(--bg); color: var(--txt); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--txt); color: var(--txt-bright); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--txt);
    margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--txt-bright);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-input::placeholder { color: var(--muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-info { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--info); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
}
.badge-free { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-pro { background: var(--accent-glow); color: var(--accent); }
.badge-agency { background: rgba(139,92,246,0.15); color: #a78bfa; }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    background: var(--bg);
}
td { font-size: 14px; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--txt-bright); }
.stat-change { font-size: 13px; margin-top: 8px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.show { display: flex; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
}
.modal-content {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover { color: var(--txt-bright); }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--card);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    width: fit-content;
}
.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 8px;
    transition: all 0.2s;
}
.tab:hover { color: var(--txt); }
.tab.active { background: var(--accent); color: white; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin-bottom: 24px; }

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; border-radius: 16px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 800; color: var(--txt-bright); }

/* User Info */
.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info h4 { font-size: 14px; margin-bottom: 2px; }
.user-info p { font-size: 12px; color: var(--muted); }

/* Progress */
.progress {
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}
.progress-bar.success { background: var(--success); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
}
.dropdown-item:hover { background: var(--bg); }

/* Auth Pages */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-logo {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}
.auth-logo span { color: var(--accent); }
.auth-subtitle {
    text-align: center;
    color: var(--muted);
    margin-bottom: 32px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--muted);
}
.auth-footer a { color: var(--accent); }

/* Landing */
.landing-hero {
    text-align: center;
    padding: 100px 20px;
    max-width: 800px;
    margin: 0 auto;
}
.landing-hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--txt-bright) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.landing-hero p {
    font-size: 18px;
    color: var(--muted);
    margin-bottom: 40px;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 20px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tabs { width: 100%; overflow-x: auto; }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
