/* ==========================================================================
   Admin Panel CSS - Premium Dark Theme
   ========================================================================== */

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

:root {
    /* Color Palette - Deep space dark mode */
    --bg-base: #0B0E14; /* Very dark blue-gray */
    --bg-surface: #151A23; /* Slightly lighter for cards */
    --bg-surface-elevated: #1F2633;
    
    --primary: #3B82F6; /* Vibrant Blue */
    --primary-hover: #2563EB;
    --primary-glow: rgba(59, 130, 246, 0.5);
    
    --secondary: #8B5CF6; /* Purple accent */
    
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(59, 130, 246, 0.3);
    
    --danger: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transitions & Shadows */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Optional grid background pattern for tech feel */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ==========================================================================
   Glassmorphism Utilities
   ========================================================================== */
.glass-panel {
    background: rgba(21, 26, 35, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: 16px;
}

.glass-card {
    background: linear-gradient(145deg, rgba(31, 38, 51, 0.6) 0%, rgba(21, 26, 35, 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), var(--shadow-glow);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Forms & Inputs
   ========================================================================== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

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

.form-control-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-control {
    width: 100%;
    background-color: rgba(11, 14, 20, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem 0.75rem 2.75rem; /* Left padding for icon */
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: rgba(11, 14, 20, 0.9);
}

.form-control:focus ~ .form-icon,
.form-control-wrapper:focus-within .form-icon {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-main);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2563EB 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
    background: linear-gradient(135deg, #4F8DF7 0%, var(--primary-hover) 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slide-down 0.4s ease-out forwards;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slide-up 0.6s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ==========================================================================
   Login Specific
   ========================================================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Animated background orbs */
.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
}

.bg-orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0) 70%);
    animation: float 20s ease-in-out infinite;
}

.bg-orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, rgba(0,0,0,0) 70%);
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    33% { transform: translate(5%, 5%); }
    66% { transform: translate(-5%, 2%); }
    100% { transform: translate(0, 0); }
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 3rem 2.5rem;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 64px;
    height: auto;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}

.login-title {
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-footer-links {
    position: absolute;
    bottom: 2rem;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    z-index: 10;
}

.login-footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-footer-links a:hover {
    color: var(--text-main);
}

/* Checkbox styling */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.custom-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(11, 14, 20, 0.4);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.custom-checkbox:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-forgot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Admin Layout Structure
   ========================================================================== */
.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-smooth);
    z-index: 100;
}

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

.sidebar-logo {
    width: 32px;
    height: 32px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background-color: rgba(59, 130, 246, 0.1);
    border-right: 3px solid var(--primary);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-base);
}

.admin-topbar {
    height: 70px;
    background-color: rgba(21, 26, 35, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 50;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Overview Layout */
.overview-header {
    margin-bottom: 2rem;
}

.overview-header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.overview-header p {
    color: var(--text-muted);
}

/* Grid Layouts */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Horizontal Scroll Container */
.scroll-section {
    margin-bottom: 2rem;
}

.scroll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.scroll-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.news-card {
    min-width: 300px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.news-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.news-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: rgba(59, 130, 246, 0.2); color: #60A5FA; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Two Column Layout */
.grid-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .grid-2col { grid-template-columns: 1fr; }
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
}

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

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Image Upload Preview Items */
.image-upload-item {
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.image-upload-item:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.image-upload-item span.material-symbols-outlined {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.image-upload-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

.image-upload-item.has-image {
    border-style: solid;
    padding: 0;
    cursor: default;
}

.image-upload-item.has-image div {
    width: 100%;
    height: 100%;
    position: relative;
}

.image-upload-item.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.image-upload-item.has-image button {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.2s;
}

.image-upload-item.has-image button:hover {
    background: rgb(220, 38, 38);
}

.image-upload-item.has-image p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}