:root {
    --bg-primary: #0a0f1e;
    --bg-secondary: #111827;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --accent-primary: #00e5ff;
    --accent-secondary: #6c63ff;
    --accent-gradient: linear-gradient(135deg, #6c63ff 0%, #00e5ff 100%);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.1);
    --glow-cyan: 0 0 30px rgba(0, 229, 255, 0.3);
    --font-headline: 'Syne', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 400px;
}

.login-logo {
    font-family: var(--font-headline);
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}

.login-logo span {
    color: var(--accent-primary);
}

.login-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    width: 100%;
}

.btn-primary:hover {
    box-shadow: var(--glow-cyan);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    padding: 10px 20px;
    font-size: 14px;
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.login-error {
    color: #ff5f56;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
    display: none;
}

/* Admin Layout */
.admin-layout {
    display: none;
    min-height: 100vh;
}

.admin-layout.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-logo {
    font-family: var(--font-headline);
    font-size: 22px;
    font-weight: 800;
    padding: 0 24px;
    margin-bottom: 40px;
}

.sidebar-logo span {
    color: var(--accent-primary);
}

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

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.sidebar-logout {
    margin-top: 40px;
    padding: 0 24px;
}

.sidebar-logout .btn-outline {
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header .btn-primary {
    flex-shrink: 0;
    white-space: nowrap;
}

.page-title {
    font-family: var(--font-headline);
    font-size: 28px;
    font-weight: 700;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 24px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-headline);
    font-size: 36px;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

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

th, td {
    padding: 16px 20px;
    text-align: left;
}

th {
    background: var(--bg-secondary);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    font-size: 14px;
    border-top: 1px solid var(--border-subtle);
}

tr:hover td {
    background: var(--bg-card-hover);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.status-processing {
    background: rgba(0, 229, 255, 0.2);
    color: var(--accent-primary);
}

.status-completed {
    background: rgba(39, 202, 64, 0.2);
    color: #27ca40;
}

.status-published {
    background: rgba(39, 202, 64, 0.2);
    color: #27ca40;
}

.status-draft {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

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

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-family: var(--font-headline);
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 12px;
}

.modal-footer .btn {
    flex: 1;
    justify-content: center;
}

.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    min-height: 150px;
    resize: vertical;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
}

/* File Upload */
.file-upload-wrapper {
    border: 2px dashed var(--border-light);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: var(--bg-primary);
}

.file-upload-wrapper:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

.file-upload-wrapper.dragover {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.1);
}

.file-upload-content p {
    color: var(--text-secondary);
    margin: 12px 0 4px;
    font-size: 14px;
}

.file-upload-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.file-upload-wrapper img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

.file-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 95, 86, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Multi-image upload */
.multi-image-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    min-height: 120px;
}

.image-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100px;
    height: 100px;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.image-upload-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 95, 86, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.existing-image-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

.existing-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.existing-image-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 95, 86, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range-picker input[type="date"] {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
}

.date-range-picker input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-range-picker span {
    color: var(--text-muted);
}

/* Contact Detail */
.contact-detail-item {
    margin-bottom: 20px;
}

.contact-detail-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.contact-detail-item span {
    font-size: 15px;
    color: var(--text-primary);
}

.contact-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-primary);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.attachment-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.attachment-link:hover {
    background: rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.attachment-link svg {
    flex-shrink: 0;
}

/* Page sections */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

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

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        padding: 16px 0;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 16px;
    }
    
    .sidebar-item {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .sidebar-link {
        padding: 12px 16px;
        white-space: nowrap;
    }
    
    .sidebar-logout {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}

/* Quill Editor Dark Theme Customization */
.ql-toolbar.ql-snow {
    border-color: var(--border-subtle);
    background: var(--bg-primary);
}

.ql-container.ql-snow {
    border-color: var(--border-subtle);
    background: var(--bg-primary);
    font-family: var(--font-body);
    font-size: 15px;
}

.ql-editor {
    color: var(--text-primary);
    min-height: 150px;
}

.ql-editor.ql-blank::before {
    color: var(--text-muted);
    font-style: normal;
}

.ql-snow .ql-stroke {
    stroke: var(--text-secondary);
}

.ql-snow .ql-fill {
    fill: var(--text-secondary);
}

.ql-snow .ql-picker {
    color: var(--text-secondary);
}

.ql-snow .ql-picker-options {
    background: var(--bg-secondary);
    border-color: var(--border-subtle);
}

.ql-snow.ql-toolbar button:hover,
.ql-snow .ql-toolbar button:hover,
.ql-snow.ql-toolbar button.ql-active,
.ql-snow .ql-toolbar button.ql-active {
    color: var(--accent-primary);
}

.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
    stroke: var(--accent-primary);
}

.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
    fill: var(--accent-primary);
}
