/* ================================================
   부거AI - style.css
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:        #0d0d0f;
    --surface:   #16161a;
    --surface2:  #1e1e24;
    --border:    #2a2a32;
    --accent:    #7c5cfc;
    --accent2:   #a78bfa;
    --text:      #e8e8f0;
    --text2:     #9090a8;
    --danger:    #e05c5c;
    --success:   #4caf82;
    --radius:    12px;
    --radius-sm: 8px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ── 레이아웃 ─────────────────────────────────── */
.layout { display: flex; flex-direction: column; min-height: 100vh; }

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo span { color: var(--accent2); }

nav { display: flex; align-items: center; gap: 1rem; }
nav a {
    color: var(--text2);
    text-decoration: none;
    font-size: 14px;
    transition: color .15s;
}
nav a:hover { color: var(--text); }
nav .btn-nav {
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
nav .btn-nav:hover { background: #6a4de0; color: #fff; }

main { flex: 1; padding: 2rem; max-width: 900px; margin: 0 auto; width: 100%; }

footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 13px;
    color: var(--text2);
    border-top: 1px solid var(--border);
}

/* ── 카드 ─────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text);
}

/* ── 폼 요소 ──────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 90px; }

/* ── 버튼 ─────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all .15s;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #6a4de0; }
.btn-primary:disabled { background: #444; color: #888; cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c04040; }
.btn-success { background: var(--success); color: #fff; }
.btn-full { width: 100%; }

/* ── 뱃지 ─────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-pending  { background: #3a3010; color: #f0c040; }
.badge-approved { background: #0f3020; color: #4caf82; }
.badge-banned   { background: #300f0f; color: #e05c5c; }

/* ── 알림 ─────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 14px;
}
.alert-error   { background: #2a1010; border: 1px solid #5a2020; color: #f08080; }
.alert-success { background: #0a2010; border: 1px solid #1a5030; color: #60c090; }
.alert-info    { background: #101828; border: 1px solid #1e3a5f; color: #6ab0f0; }

/* ── 크레딧 표시 ──────────────────────────────── */
.credit-bar {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    font-size: 14px;
}
.credit-count { font-weight: 600; color: var(--accent2); font-size: 1.1rem; }

/* ── 업로드 영역 ──────────────────────────────── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--surface2);
    position: relative;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: #1a1830;
}
.upload-area input[type=file] {
    position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 2.5rem; margin-bottom: .5rem; display: block; }
.upload-text { color: var(--text2); font-size: 14px; }
.upload-preview {
    max-width: 280px;
    max-height: 280px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    margin-top: 1rem;
    display: none;
}

/* ── 옵션 그리드 ──────────────────────────────── */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .options-grid { grid-template-columns: 1fr; } }

/* ── 결과 이미지 ──────────────────────────────── */
.result-area { display: none; }
.result-img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 1rem;
}
.loading-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent));
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
    margin: 1rem 0;
    display: none;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── 히스토리 그리드 ──────────────────────────── */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 1rem;
}
.history-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s;
}
.history-item:hover { border-color: var(--accent); }
.history-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.history-meta { padding: 8px; font-size: 12px; color: var(--text2); }

/* ── 관리자 테이블 ────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.admin-table th { color: var(--text2); font-weight: 500; background: var(--surface2); }
.admin-table tr:hover td { background: #1a1a20; }

/* ── 인증 페이지 ──────────────────────────────── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 2rem;
}
.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.25rem;
}
.auth-logo {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.auth-logo span { color: var(--accent2); }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 13px; color: var(--text2); }
.auth-footer a { color: var(--accent2); text-decoration: none; }

/* ── 탭 ───────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}
.tab-btn {
    padding: 8px 18px;
    font-size: 14px;
    border: none;
    background: none;
    color: var(--text2);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .15s;
}
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent2); }

/* ── 반응형 ───────────────────────────────────── */
@media (max-width: 640px) {
    main { padding: 1rem; }
    header { padding: 0 1rem; }
    .card { padding: 1.1rem; }
}
