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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* === Screen Toggle === */
.screen { display: none; }
.screen.active { display: block; }

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* === Login === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1A1A2E 0%, #2d2d44 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #D4A843, #C67A2E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 32px;
    font-size: 14px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    color: #2c3e50;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #D4A843;
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #fecaca;
}

/* === Buttons === */
.btn-primary {
    background: linear-gradient(135deg, #D4A843, #C67A2E);
    color: #1A1A2E;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: #fff;
    color: #2c3e50;
    border: 1px solid #e0e6ed;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-secondary:hover { background: #f8f9fa; transform: translateY(-1px); }

.btn-success {
    background: #27ae60;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-danger:hover { opacity: 0.9; }

.btn-warning {
    background: #f59e0b;
    color: #1A1A2E;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-warning:hover { opacity: 0.9; }

.btn-small { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* === Header === */
.app-header {
    background: #fff;
    border-bottom: 1px solid #e0e6ed;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #D4A843, #C67A2E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.admin-email {
    color: #7f8c8d;
    font-size: 13px;
}

/* === Nav Tabs === */
.nav-tabs {
    background: #fff;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 32px;
    position: sticky;
    top: 57px;
    z-index: 99;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
}

.nav-tab:hover { color: #2c3e50; }
.nav-tab.active { color: #D4A843; border-bottom-color: #D4A843; }

.badge {
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* === Tab Content === */
.tab-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

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

.tab-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filters select,
.filters input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #2c3e50;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: #D4A843;
}

/* === Items List === */
.items-list {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.item-card {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s;
}

.item-card:hover { background: #f8f9fa; }
.item-card:last-child { border-bottom: none; }

.item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.item-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.item-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 2px;
}

.item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #7f8c8d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Art card thumbnail */
.item-card-art {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.art-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f2f5;
}

.art-card-info { flex: 1; min-width: 0; }

/* === Status Badges === */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-published { background: #d1fae5; color: #065f46; }
.status-featured { background: #ede9fe; color: #5b21b6; }
.status-rejected { background: #fef2f2; color: #991b1b; }
.status-archived { background: #f3f4f6; color: #4b5563; }
.status-draft { background: #e0e7ff; color: #3730a3; }
.status-active { background: #d1fae5; color: #065f46; }
.status-expired { background: #f3f4f6; color: #4b5563; }
.status-spotlight { background: #fdf4ff; color: #86198f; }

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-large { max-width: 900px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.modal-close:hover { color: #2c3e50; }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e6ed;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* === Art Modal === */
.art-image-container {
    text-align: center;
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
}

.art-image-full {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    object-fit: contain;
}

/* === Detail Sections === */
.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #7f8c8d;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f2f5;
}

.detail-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
}

.detail-value {
    color: #2c3e50;
    word-break: break-word;
}

.detail-value a {
    color: #D4A843;
    text-decoration: none;
}

.detail-value a:hover { text-decoration: underline; }

/* Blog content preview */
.blog-content-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
}

.blog-content-preview h1,
.blog-content-preview h2,
.blog-content-preview h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

.blog-content-preview h2 { font-size: 18px; }
.blog-content-preview h3 { font-size: 16px; }
.blog-content-preview p { margin-bottom: 12px; }
.blog-content-preview ul, .blog-content-preview ol { margin: 8px 0; padding-left: 24px; }
.blog-content-preview li { margin-bottom: 4px; }

/* Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: #f3f4f6;
    color: #4b5563;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Spotlight contender indicator */
.spotlight-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fdf4ff;
    color: #86198f;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

/* Category select in modal */
.category-select {
    padding: 8px 12px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #2c3e50;
}

.category-select:focus {
    outline: none;
    border-color: #D4A843;
}

/* === Loading & Empty States === */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state-text {
    color: #7f8c8d;
    font-size: 15px;
}

/* === Stats Row === */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid #D4A843;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 4px;
}

/* === Ad Form === */
.ad-form {
    display: grid;
    gap: 16px;
}

.ad-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .app-header { padding: 12px 16px; }
    .header-title { font-size: 16px; }
    .admin-email { display: none; }
    .nav-tabs { padding: 0 16px; }
    .tab-content { padding: 16px; }
    .tab-header { flex-direction: column; align-items: flex-start; }
    .filters { width: 100%; }
    .filters select { flex: 1; min-width: 0; }
    .item-card { padding: 14px 16px; }
    .item-card-art { flex-direction: column; }
    .art-thumbnail { width: 100%; height: 120px; }
    .detail-row { grid-template-columns: 1fr; gap: 2px; }
    .modal-content { max-height: 95vh; }
    .modal-footer { flex-direction: column; }
    .modal-footer button { width: 100%; }
    .ad-form .form-row { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .nav-tab { padding: 12px 14px; font-size: 13px; }
    .stats-row { grid-template-columns: 1fr; }
}
