/* Main CSS for Premium Admin Panel */
:root {
    --primary-bg: #0f172a; /* Deep Navy Dark Mode */
    --secondary-bg: #1e293b;
    --accent-blue: #3b82f6; /* Electric Blue */
    --accent-indigo: #6366f1;
    --accent-emerald: #10b981; /* Success Green */
    --accent-rose: #f43f5e; /* Danger Red */
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --sidebar-width: 260px;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(148, 163, 184, 0.1);
    --transition-speed: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    transition: var(--transition-speed);
}

.sidebar .brand {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: var(--transition-speed);
}

.nav-item.active,
.nav-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2.5rem;
    max-width: calc(100% - var(--sidebar-width));
}

.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.section-title h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.section-title p {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-blue);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.stat-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.trend-up { color: var(--accent-emerald); }
.trend-down { color: var(--accent-rose); }

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* AI Insights Component */
.ai-insight-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.ai-icon {
    background: var(--accent-indigo);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 0; padding: 0; }
    .main-content { margin-left: 0; padding: 1.5rem; max-width: 100%; }
}

/* Tables & Forms Premium Looks */
.table-container {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(148, 163, 184, 0.05);
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
}

td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary); /* Ensure text is white/light */
}

/* Fix action icon visibility and styling */
.action-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.05); /* Very subtle background */
}

/* Edit Button */
.btn-edit {
    color: var(--accent-blue) !important;
}
.btn-edit:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

/* Delete Button */
.btn-delete {
    color: var(--accent-rose) !important;
}
.btn-delete:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    transform: scale(1.05);
}

/* Make icons stand out */
.action-btn svg, .action-btn i,
.btn i, .btn svg {
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    stroke-width: 2.5px !important; /* Thicker for better visibility */
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary { background: var(--accent-blue); color: white; }
select {
    width: 100%;
    padding: 0.75rem;
    background: #1e293b; /* Darker solid background for select */
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: white;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

select option {
    background-color: #0f172a; /* Ensure dropdown options are readable */
    color: white;
    padding: 10px;
}

/* Modal Styling for Editing */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.938rem;
    transition: var(--transition-speed);
}

/* Login Page Styling */
.login-body {
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.login-brand {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #3b82f6, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.login-input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
}

.login-input:focus {
    border-color: var(--accent-blue);
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.error-msg {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.1);
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(244, 63, 94, 0.2);
}
