/* 관리자 스타일 (Admin Styles) */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 250px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* 로그인 페이지 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2em;
    color: #666;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 관리자 헤더 */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.admin-header h1 {
    font-size: 1.5em;
}

.admin-header h1 a {
    color: var(--primary-color);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 0.9em;
    color: #666;
}

/* 관리자 컨테이너 */
.admin-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* 사이드바 */
.admin-sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu li.nav-section {
    padding: 15px 20px 10px;
    font-size: 0.85em;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background 0.3s;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-menu li.active a {
    background: rgba(255,255,255,0.15);
    border-left: 3px solid var(--primary-color);
}

.nav-menu .icon {
    width: 30px;
    font-size: 18px;
}

/* 메인 컨텐츠 */
.admin-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.content-header p {
    color: #666;
    font-size: 0.95em;
}

/* 카드 */
.card {
    background: white;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 20px;
    font-size: 1.3em;
    color: var(--dark-color);
}

/* 데이터 테이블 */
.prompt-table-card {
    padding: 32px;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-subtitle {
    color: #64748b;
    font-size: 0.95em;
}

.table-legends {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
    color: #94a3b8;
}

.table-legends span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-html {
    background: #1d4ed8;
}

.legend-gnb {
    background: #a21caf;
}

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    min-width: 720px;
}

.data-table thead th {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-align: left;
    padding: 0 18px 8px;
    border: none;
}

.data-table tbody tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-table tbody tr:hover {
    transform: translateY(-2px);
}

.data-table tbody tr td {
    background: #ffffff;
    border: none;
    padding: 18px;
    font-size: 0.95em;
    color: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.data-table tbody tr td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.data-table tbody tr td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.prompt-name {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-name strong {
    font-size: 1em;
    color: #0f172a;
}

.prompt-date {
    font-size: 0.8em;
    color: #94a3b8;
}

.prompt-desc {
    max-width: 360px;
    color: #475569;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn.ghost {
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.15);
    color: #0f172a;
}

.btn.ghost.btn-primary {
    color: var(--primary-color);
    border-color: rgba(0, 102, 204, 0.3);
}

.btn.ghost.btn-danger {
    color: var(--danger-color);
    border-color: rgba(220, 53, 69, 0.3);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-secondary {
    background: var(--secondary-color);
}

.btn-success {
    background: var(--success-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* 대시보드 통계 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 3em;
}

.stat-content h3 {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.dashboard-section {
    background: white;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dashboard-section h2 {
    margin-bottom: 20px;
}

.status-stats,
.category-stats {
    display: grid;
    gap: 10px;
}

.status-item,
.category-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--light-color);
    border-radius: 4px;
}

.status-value,
.category-count {
    font-weight: bold;
    color: var(--primary-color);
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* 테마 그리드 */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.theme-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.theme-thumbnail {
    width: 100%;
    height: 200px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.theme-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    font-size: 4em;
    color: #ddd;
}

.theme-info {
    padding: 20px;
}

.theme-info h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.theme-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75em;
    border-radius: 3px;
    background: var(--light-color);
    color: #333;
}

.badge-primary {
    background: #e0edff;
    color: #1d4ed8;
}

.badge-success {
    background: #f3e8ff;
    color: #9333ea;
}

.badge-static_html {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-gnuboard {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-status-published {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-status-draft {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-status-archived {
    background: #eceff1;
    color: #546e7a;
}

.theme-description {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.theme-stats {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
}

.theme-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 알림 */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--danger-color);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info-color);
    color: #0c5460;
}

/* 정보 박스 */
.info-box {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 4px;
    border-left: 4px solid var(--info-color);
    margin-top: 20px;
}

.info-box h3 {
    margin-bottom: 10px;
    color: var(--info-color);
}

.info-box ul {
    padding-left: 20px;
}

.info-box li {
    margin-bottom: 8px;
    color: #0c5460;
}

/* 로딩 */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 페이지네이션 */
.pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 5px;
}

.page-item {
    display: inline-block;
}

.page-link {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
}

.page-link:hover {
    background: var(--light-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: #ccc;
    cursor: not-allowed;
}

/* 필터 */
.filters-card {
    margin-bottom: 20px;
}

.filters-form .form-row {
    align-items: flex-end;
}

/* 파일 목록 */
.file-list .file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.file-list .file-item:last-child {
    border-bottom: none;
}

.file-icon {
    font-size: 24px;
    margin-right: 15px;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-size {
    margin-right: 15px;
    color: #666;
    font-size: 0.9em;
}

/* 썸네일 미리보기 */
.thumbnail-preview {
    margin-bottom: 15px;
}

.thumbnail-preview img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 통계 목록 */
.stats-list {
    list-style: none;
}

.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.stats-list li:last-child {
    border-bottom: none;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* 그리드 레이아웃 */
.row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 14px);
}

.col-md-6 {
    flex: 0 0 calc(50% - 10px);
}

.col-md-8 {
    flex: 0 0 calc(66.667% - 14px);
}

/* 체크박스 라벨 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* 반응형 */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
    }
    
    .content-header {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .themes-grid {
        grid-template-columns: 1fr;
    }
}
