/* DCM Vigilance Premium Admin Theme Stylesheet */
:root {
    --bg-main: #0a0f24;
    --bg-card: #13193a;
    --bg-sidebar: #060b21;
    --bg-input: #1b224d;
    --border-color: #242c5c;
    --primary-color: #D4A017;
    --primary-hover: #e2ab0a;
    --text-color: #e0e6ed;
    --text-muted: #8492a6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --gold-glow: 0 0 15px rgba(255, 194, 14, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Login Wrapper */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, #1b265e 0%, var(--bg-main) 100%);
    padding: 20px;
}

.login-card {
    background: rgba(19, 25, 58, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--gold-glow);
    text-align: center;
}

.login-logo img {
    height: 70px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.login-logo h2 {
    font-family: 'Outfit', sans-serif;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.login-logo span {
    color: var(--primary-color);
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 4px;
    margin-bottom: 30px;
}

/* Form controls */
.form-group {
    margin-bottom: 22px;
    text-align: left;
}

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

.form-group label i {
    color: var(--primary-color);
    margin-right: 5px;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14.5px;
    transition: all 0.25s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 194, 14, 0.15);
}

.btn-submit {
    width: 100%;
    background-color: var(--primary-color);
    border: none;
    color: #060b21;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    padding: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--gold-glow);
}

.error-msg {
    display: none;
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.4;
}

/* Dashboard Container */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header img {
    height: 42px;
}

.sidebar-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.sidebar-header span {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav {
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background-color: rgba(255, 194, 14, 0.08);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-logout {
    margin-top: auto;
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Workspace */
.workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

.workspace-header {
    padding: 20px 30px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99;
}

.workspace-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile span {
    font-size: 12px;
    color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.panel-container {
    padding: 30px;
    flex-grow: 1;
}

/* Panels active/inactive states */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-yellow {
    background-color: rgba(255, 194, 14, 0.12);
    color: var(--primary-color);
}

.bg-purple {
    background-color: rgba(168, 85, 247, 0.12);
    color: #a855f7;
}

.bg-blue {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 2px;
}

.stat-info span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Dashboard Guide Card */
.dashboard-info-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    line-height: 1.6;
}

.dashboard-info-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    margin-bottom: 12px;
}

.dashboard-info-card p {
    color: var(--text-color);
    margin-bottom: 24px;
}

.info-guide {
    background-color: rgba(6, 11, 33, 0.4);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.info-guide h3 {
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.info-guide ul {
    list-style-type: none;
}

.info-guide li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    font-size: 13.5px;
}

.info-guide li:last-child {
    margin-bottom: 0;
}

.info-guide li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    font-size: 18px;
    position: absolute;
    left: 4px;
    top: -2px;
}

/* Site settings grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14.5px;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save {
    background-color: var(--primary-color);
    color: #060b21;
}

.btn-save:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--gold-glow);
}

.btn-secondary {
    background-color: var(--bg-input);
    color: #fff;
    border: 1px solid var(--border-color);
}

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

.btn-cancel {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Page Editor dropdown control */
.editor-header-control {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-header-control label {
    font-weight: 600;
    font-size: 14.5px;
}

.select-control {
    max-width: 320px;
}

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

.card-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

/* Editable field blocks inside Page Editor */
.fields-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 30px;
}

.field-block {
    background-color: rgba(6, 11, 33, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.field-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.field-meta label {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.field-meta span {
    font-size: 11px;
    text-transform: uppercase;
    background-color: var(--border-color);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Image inputs block */
.image-field-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.img-preview-box {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #060b21;
    flex-shrink: 0;
}

.input-with-button {
    display: flex;
    gap: 10px;
    flex-grow: 1;
}

.input-with-button button {
    flex-shrink: 0;
}

/* Quill text overrides */
.ql-toolbar.ql-snow {
    border-color: var(--border-color) !important;
    background-color: var(--bg-sidebar) !important;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.ql-toolbar.ql-snow .ql-stroke {
    stroke: var(--text-muted) !important;
}

.ql-toolbar.ql-snow .ql-fill {
    fill: var(--text-muted) !important;
}

.ql-toolbar.ql-snow .ql-picker {
    color: var(--text-muted) !important;
}

.ql-container.ql-snow {
    border-color: var(--border-color) !important;
    background-color: var(--bg-input) !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    color: #fff !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14.5px !important;
}

/* Image Gallery Layout */
.gallery-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 992px) {
    .gallery-layout {
        grid-template-columns: 1fr;
    }
}

.upload-card {
    position: sticky;
    top: 20px;
}

.drag-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    background-color: rgba(6, 11, 33, 0.2);
}

.drag-drop-zone:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 194, 14, 0.03);
}

.drag-drop-zone i {
    font-size: 32px;
    color: var(--primary-color);
}

.drag-drop-zone span {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
}

.gallery-filter-bar {
    margin-bottom: 20px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 5px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    aspect-ratio: 1;
    background-color: #060b21;
    cursor: pointer;
    group: hover;
}

.gallery-item-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-img {
    transform: scale(1.06);
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 11, 33, 0.95) 0%, rgba(6, 11, 33, 0.4) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-name {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.btn-copy-path {
    background-color: var(--primary-color);
    color: #060b21;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

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

/* Modals */
.modal-wrapper {
    position: fixed;
    inset: 0;
    background-color: rgba(6, 11, 33, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 1050;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

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

.modal-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
}

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

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.image-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.selector-item {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-size: cover;
    background-position: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.selector-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 194, 14, 0.15);
}

.selector-item-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(6, 11, 33, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    padding: 4px;
}

.selector-item:hover .selector-item-overlay {
    opacity: 1;
}

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #fff;
    font-size: 16.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 13.5px;
    max-width: 320px;
    line-height: 1.4;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 14.5px;
    padding: 40px 0;
    width: 100%;
}

.loading-spinner i {
    color: var(--primary-color);
}

.max-w-500 {
    max-width: 500px;
}

.mt-4 { margin-top: 24px; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 12px; }

/* Responsive adjustments */
.mobile-nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-nav-toggle-btn {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1200;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 1150;
        display: none;
    }
    
    .sidebar-backdrop.open {
        display: block;
    }
    
    .workspace-header {
        padding: 15px 20px;
    }
    
    .panel-container {
        padding: 20px;
    }
    
    .image-field-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .img-preview-box {
        width: 80px;
        height: 80px;
    }
}

/* Submissions Table & List Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}

.admin-table th {
    background-color: var(--bg-sidebar);
    color: var(--primary-color);
    padding: 14px 16px;
    font-weight: 600;
    font-size: 13.5px;
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.submission-date {
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-muted);
}

.submission-sender {
    font-weight: 600;
    color: #fff;
}

.submission-email {
    color: var(--text-color);
}

.submission-subject {
    font-weight: 500;
    color: var(--primary-color);
}

.submission-message-text {
    max-width: 300px;
    white-space: pre-wrap;
    line-height: 1.4;
    font-size: 13px;
    max-height: 100px;
    overflow-y: auto;
    color: var(--text-color);
}

.btn-delete-submission {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger-color);
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.btn-delete-submission:hover {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
}
