/* admin.css - Premium Overhaul */
:root {
    --primary-color: #ffbd08;
    --secondary-color: #0b0c1c; /* Deeper dark blue */
    --accent-color: #37d4d9;
    --text-color: #505050;
    --bg-color: #f4f6f9;
    --white: #ffffff;
    --danger: #ff4757;
    --success: #2ed573;
    --warning: #ffa502;
    --info: #1e90ff;
    --border-color: #e4e7ea;
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Jost', sans-serif; background-color: var(--bg-color); color: var(--text-color); line-height: 1.6; scroll-behavior: smooth; }
a { text-decoration: none; color: var(--secondary-color); transition: var(--transition); }
a:hover { color: var(--primary-color); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Login Page */
.login-page {
    display: flex; justify-content: center; align-items: center; height: 100vh;
    background: linear-gradient(135deg, var(--secondary-color), #1e2038);
}
.login-card {
    background: var(--white); padding: 40px; border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); width: 100%; max-width: 420px;
    animation: zoomIn 0.5s ease forwards;
}
.login-card h2 { text-align: center; margin-bottom: 30px; color: var(--secondary-color); font-weight: 800; font-size: 2rem; }

/* Form Controls */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; color: #444; }
.form-control {
    width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px;
    font-family: 'Jost', sans-serif; font-size: 1rem; background: #fafbfe; transition: var(--transition);
}
.form-control:focus { border-color: var(--primary-color); outline: none; background: var(--white); box-shadow: 0 0 0 4px rgba(255,189,8,0.1); }
textarea.form-control { resize: vertical; }

/* Buttons */
.btn {
    display: inline-block; padding: 12px 20px; border: none; border-radius: 8px;
    cursor: pointer; font-family: 'Jost', sans-serif; font-weight: 600; text-align: center;
    transition: var(--transition); letter-spacing: 0.5px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary-color), #e0a606); color: var(--secondary-color); box-shadow: 0 5px 15px rgba(255,189,8,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,189,8,0.4); }
.btn-danger { background: var(--danger); color: var(--white); box-shadow: 0 5px 15px rgba(255,71,87,0.2); }
.btn-outline { border: 2px solid var(--border-color); background: transparent; color: var(--secondary-color); font-weight: 600; }
.btn-outline:hover { border-color: var(--secondary-color); background: var(--secondary-color); color: var(--white); }
.btn-sm { padding: 8px 15px; font-size: 0.9rem; }
.btn-block { display: block; width: 100%; }

/* Layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px; background: linear-gradient(to bottom, var(--secondary-color), #14152a);
    color: var(--white); transition: var(--transition); display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05); z-index: 50;
}
.sidebar.collapsed { margin-left: -260px; }
.sidebar-brand { padding: 25px 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.sidebar-brand a { color: var(--primary-color); font-size: 1.6rem; font-weight: 800; }
.sidebar-logo { max-width: 160px; max-height: 60px; }
.sidebar-menu { list-style: none; padding: 20px 0; }
.sidebar-menu .menu-header { padding: 10px 25px; font-size: 0.75rem; text-transform: uppercase; color: rgba(255,255,255,0.4); letter-spacing: 1px; margin-top: 10px; font-weight: 700; }
.sidebar-menu a {
    display: flex; align-items: center; padding: 12px 25px; color: rgba(255,255,255,0.6);
    position: relative; transition: var(--transition);
}
.sidebar-menu a::before {
    content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 4px;
    background: var(--primary-color); transform: scaleY(0); transition: var(--transition); border-radius: 0 4px 4px 0;
}
.sidebar-menu a:hover, .sidebar-menu a.active { color: var(--white); background: rgba(255,255,255,0.03); }
.sidebar-menu a:hover::before, .sidebar-menu a.active::before { transform: scaleY(1); }
.sidebar-menu i { width: 30px; font-size: 1.1rem; color: rgba(255,255,255,0.5); transition: var(--transition); }
.sidebar-menu a:hover i, .sidebar-menu a.active i { color: var(--primary-color); }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg-color); }
.top-header {
    background: var(--white); padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow-sm); z-index: 40; position: sticky; top: 0;
}
.header-left { display: flex; align-items: center; gap: 20px; }
.header-left h2 { font-weight: 700; color: var(--secondary-color); }
.header-right { display: flex; align-items: center; gap: 25px; }
.user-dropdown { display: flex; align-items: center; gap: 15px; font-weight: 600; }
.btn-logout { color: var(--danger); font-size: 1.2rem; }
.content-body { padding: 30px; flex: 1; }

/* Dashboard Cards */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; margin-bottom: 40px; }
.stat-card {
    background: var(--white); padding: 25px; border-radius: 12px; display: flex; align-items: center;
    box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-card::after {
    content: ''; position: absolute; right: -20px; bottom: -20px; width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(0,0,0,0.03) 0%, transparent 70%); border-radius: 50%;
}
.stat-icon {
    width: 65px; height: 65px; border-radius: 12px; background: rgba(255,189,8,0.1); color: var(--primary-color);
    display: flex; justify-content: center; align-items: center; font-size: 1.8rem; margin-right: 20px;
}
.stat-icon.bg-success { background: rgba(46,213,115,0.1); color: var(--success); }
.stat-icon.bg-warning { background: rgba(255,165,2,0.1); color: var(--warning); }
.stat-icon.bg-info { background: rgba(30,144,255,0.1); color: var(--info); }
.stat-details h3 { font-size: 2rem; line-height: 1; margin-bottom: 5px; color: var(--secondary-color); }
.stat-details p { color: #888; margin: 0; font-weight: 500; font-size: 0.95rem; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media (max-width: 992px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Common Cards */
.card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-sm); margin-bottom: 25px; animation: fadeInUp 0.4s ease forwards; }
.card-header { padding: 20px 25px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-weight: 700; color: var(--secondary-color); font-size: 1.2rem; }
.card-body { padding: 25px; }

/* Tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table th { font-weight: 600; color: #888; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background-color: #fafbfe; }

/* Badges */
.badge { padding: 5px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.5px; }
.badge-success { background: rgba(46,213,115,0.1); color: var(--success); }
.badge-warning { background: rgba(255,165,2,0.1); color: var(--warning); }

/* Alerts */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert::before { font-family: "Font Awesome 6 Free"; font-weight: 900; }
.alert-danger { background: rgba(255,71,87,0.1); color: var(--danger); border-left: 4px solid var(--danger); }
.alert-danger::before { content: "\f071"; }
.alert-success { background: rgba(46,213,115,0.1); color: var(--success); border-left: 4px solid var(--success); }
.alert-success::before { content: "\f058"; }

/* Image Grid (Admin) */
.recent-images-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.img-preview { aspect-ratio: 1; overflow: hidden; border-radius: 8px; border: 1px solid var(--border-color); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.img-preview:hover img { transform: scale(1.1); }

/* Category Checkbox List */
.category-checkbox-list {
    display: flex; flex-wrap: wrap; gap: 10px; padding: 15px;
    background: #fafbfe; border: 1px solid var(--border-color); border-radius: 8px;
    max-height: 200px; overflow-y: auto;
}
.category-checkbox-item {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px;
    background: var(--white); border: 1px solid var(--border-color); border-radius: 50px;
    cursor: pointer; font-size: 0.95rem; font-weight: 500; color: var(--text-color);
    transition: var(--transition); user-select: none;
}
.category-checkbox-item:hover { border-color: var(--primary-color); }
.category-checkbox-item input[type="checkbox"] { accent-color: var(--primary-color); cursor: pointer; width: 16px; height: 16px; }
.category-checkbox-item:has(input:checked) {
    background: rgba(255,189,8,0.1); border-color: var(--primary-color); color: var(--secondary-color);
}

/* Drag & Drop Zone */
.drop-zone {
    max-width: 100%; min-height: 180px; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; font-family: 'Jost', sans-serif; font-weight: 600; font-size: 1.1rem; cursor: pointer; color: #888;
    border: 2px dashed #cbd5e1; border-radius: 12px; background: #f8fafc; transition: var(--transition); margin-bottom: 20px;
}
.drop-zone:hover { border-color: var(--primary-color); background: rgba(255,189,8,0.02); color: var(--secondary-color); }
.drop-zone-over { border-color: var(--primary-color); background: rgba(255,189,8,0.08); transform: scale(1.02); }
.drop-zone-input { display: none; }
.file-preview-container { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; }
.preview-thumb {
    width: 90px; height: 90px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm); animation: zoomIn 0.3s ease;
}

@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Custom WYSIWYG Editor */
.custom-editor-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    overflow: hidden;
    margin-bottom: 20px;
}
.editor-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.editor-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-color);
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}
.editor-btn:hover {
    background: rgba(255,189,8,0.1);
    color: var(--primary-color);
}
.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 5px;
}
.editor-content {
    min-height: 300px;
    padding: 20px;
    outline: none;
    font-family: 'Jost', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    overflow-y: auto;
}
.editor-content:empty::before {
    content: "Write your post here...";
    color: #a0aec0;
}
.editor-content h2, .editor-content h3 {
    color: var(--secondary-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.editor-content ul, .editor-content ol {
    margin-left: 20px;
    margin-bottom: 1em;
}
.editor-content a {
    color: var(--primary-color);
    text-decoration: underline;
}
