/* ============================================
   WPMostify — Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-sidebar: rgba(15, 23, 42, 0.95);
    --bg-input: rgba(30, 41, 59, 0.6);
    --border-color: rgba(99, 102, 241, 0.15);
    --border-hover: rgba(99, 102, 241, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --urgent: #f97316;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    --gradient-2: linear-gradient(135deg, #0f172a, #1e293b);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(99,102,241,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(59,130,246,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.5); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99,102,241,0.4);
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.5);
    color: var(--danger);
}

.btn-success {
    background: rgba(16,185,129,0.15);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.3);
}
.btn-success:hover {
    background: rgba(16,185,129,0.25);
    color: var(--success);
}

.btn-warning {
    background: rgba(245,158,11,0.15);
    color: var(--warning);
    border: 1px solid rgba(245,158,11,0.3);
}
.btn-warning:hover {
    background: rgba(245,158,11,0.25);
    color: var(--warning);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--accent);
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ============ TABLE ============ */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(30,41,59,0.4);
}
td { font-size: 0.9rem; }
tr:hover td { background: rgba(99,102,241,0.05); }

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-low { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-medium { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-high { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-urgent { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-open { background: rgba(99,102,241,0.15); color: var(--accent); }
.badge-in_progress { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-closed { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.badge-active { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-inactive { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.badge-expired { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.sidebar-logo .logo-icon {
    width: 40px; height: 40px;
    background: var(--gradient-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: white;
}
.sidebar-logo .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(99,102,241,0.1);
}
.nav-link.active {
    color: var(--accent);
    background: rgba(99,102,241,0.15);
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 24px;
    background: var(--gradient-1);
    border-radius: 0 3px 3px 0;
}
.nav-link i { width: 20px; text-align: center; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}
.user-details { flex: 1; overflow: hidden; }
.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 32px;
    position: relative;
    z-index: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}
.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============ HOMEPAGE ============ */
.homepage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.homepage-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: relative;
    z-index: 10;
}
.homepage-nav-links {
    display: flex;
    gap: 8px;
    list-style: none;
}
.homepage-nav-links a {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.homepage-nav-links a:hover { color: var(--text-primary); background: rgba(99,102,241,0.1); }
.homepage-nav-links a.btn-primary { color: white; }

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 40px;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
}
.hero-actions {
    display: flex;
    gap: 16px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}
.feature-card {
    padding: 32px;
}
.feature-card .feature-icon {
    width: 48px; height: 48px;
    background: rgba(99,102,241,0.15);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 1.3rem;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); }

/* ============ AUTH PAGES ============ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    z-index: 1;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
}
.auth-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.auth-card .auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.auth-card .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}

/* ============ ALERTS ============ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-error {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--danger);
}
.alert-success {
    background: rgba(16,185,129,0.15);
    border: 1px solid rgba(16,185,129,0.3);
    color: var(--success);
}
.alert-info {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: var(--accent);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}
.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.pagination a {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .active {
    background: var(--accent);
    color: white;
    border: none;
}

/* ============ TICKET DETAIL ============ */
.message-list { display: flex; flex-direction: column; gap: 16px; }
.message-item {
    padding: 16px 20px;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}
.message-item.admin-message {
    border-color: rgba(99,102,241,0.3);
    background: rgba(99,102,241,0.05);
}
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.message-author { font-weight: 600; font-size: 0.9rem; }
.message-date { font-size: 0.8rem; color: var(--text-muted); }
.message-body { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }

/* ============ DRAG & DROP ============ */
.sortable-container {
    display: flex;
    gap: 24px;
}
.sortable-panel {
    flex: 1;
    min-height: 200px;
}
.sortable-panel h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}
.sortable-list {
    min-height: 150px;
    padding: 12px;
    background: var(--bg-input);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sortable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: var(--transition);
}
.sortable-item:hover { border-color: var(--accent); }
.sortable-item:active { cursor: grabbing; }
.sortable-item .drag-handle {
    color: var(--text-muted);
    font-size: 1.2rem;
}
.sortable-item .item-label { flex: 1; font-weight: 500; }
.sortable-item .item-actions { display: flex; gap: 4px; }

.sortable-ghost {
    opacity: 0.4;
    border-color: var(--accent) !important;
}

/* ============ EDITOR ============ */
.editor-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.editor-tab {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: var(--transition);
}
.editor-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.editor-wrapper {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.code-editor-wrapper {
    display: none;
}
.code-editor-wrapper.active, .visual-editor-wrapper.active {
    display: block;
}

/* ============ DASHBOARD STATS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100%;
    background: linear-gradient(135deg, transparent, rgba(99,102,241,0.05));
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============ DOCUMENT PUBLIC ============ */
.doc-layout {
    display: flex;
    min-height: 100vh;
}
.doc-sidebar {
    width: 280px;
    padding: 24px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-sidebar);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.doc-sidebar h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.doc-link {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    margin-bottom: 2px;
}
.doc-link:hover { color: var(--text-primary); background: rgba(99,102,241,0.1); }
.doc-link.active { color: var(--accent); background: rgba(99,102,241,0.15); }

.doc-content {
    flex: 1;
    padding: 40px;
    max-width: 900px;
}
.doc-content h1 { font-size: 2rem; margin-bottom: 24px; }
.doc-content .content-body { color: var(--text-secondary); line-height: 1.8; }
.doc-content .content-body h2, .doc-content .content-body h3 { color: var(--text-primary); margin: 24px 0 12px; }
.doc-content .content-body p { margin-bottom: 16px; }
.doc-content .content-body code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.doc-content .content-body pre {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 16px;
}
.doc-content .content-body img { max-width: 100%; border-radius: var(--radius-sm); }

/* ============ MEDIA UPLOAD ============ */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}
.upload-area:hover {
    border-color: var(--accent);
    background: rgba(99,102,241,0.05);
}
.upload-area i { font-size: 2rem; color: var(--accent); margin-bottom: 8px; }
.upload-area p { color: var(--text-secondary); }

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar select {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
}

/* ============ MOBILE ============ */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 200;
    width: 44px; height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; }
    .main-content { margin-left: 0; padding: 20px; padding-top: 70px; }
    .sortable-container { flex-direction: column; }
    .doc-layout { flex-direction: column; }
    .doc-sidebar { width: 100%; height: auto; position: static; }
    .hero h1 { font-size: 2.5rem; }
    .features { padding: 0 20px 40px; }
    .homepage-nav { padding: 16px 20px; flex-wrap: wrap; gap: 12px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.slide-in { animation: slideIn 0.4s ease-out; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
