﻿/* ============================================
   Modern Admin Theme - Site.css
   Professional Admin Dashboard Styling
   ============================================ */

:root {
    /* Color Palette */
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Layout Variables */
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition-speed: 0.3s;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Base Styles
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ============================================
   Layout Structure
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar Styles
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform var(--transition-speed) ease-in-out;
    box-shadow: var(--shadow-xl);
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 50px;
    height: 50px;
    padding: 4px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    color: var(--gray-300);
    font-size: 0.875rem;
}

.sidebar-user-info i {
    font-size: 1.5rem;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-speed) ease-in-out;
}

/* ============================================
   Top Navigation Bar
   ============================================ */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-content {
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.btn-sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.topbar-center {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-link {
    color: var(--gray-600);
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.topbar-link:hover {
    background: var(--gray-100);
    color: var(--primary-color);
}

.btn-topbar {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.btn-topbar:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* ============================================
   Content Area
   ============================================ */
.content-area {
    flex: 1;
    padding: 2rem;
    background: var(--gray-50);
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

.content-footer {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid var(--gray-200);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   Form Controls
   ============================================ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--gray-700);
    background-color: white;
    background-clip: padding-box;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
    max-width: 600px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="text"]:disabled,
input[type="password"]:disabled,
select:disabled,
textarea:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* ============================================
   Buttons
   ============================================ */
input[type="submit"],
input[type="button"],
button:not(.btn-sidebar-toggle):not(.btn-topbar) {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    color: white;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:not(.btn-sidebar-toggle):not(.btn-topbar):hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

input[type="submit"]:active,
input[type="button"]:active,
button:not(.btn-sidebar-toggle):not(.btn-topbar):active {
    transform: translateY(0);
}

/* ============================================
   Tables
   ============================================ */
table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--gray-700);
    border-collapse: collapse;
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    background-color: var(--gray-100);
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table td {
    padding: 0.875rem;
    border-bottom: 1px solid var(--gray-200);
}

table tr:hover {
    background-color: var(--gray-50);
}

table.detail {
    background: white;
    border: 1px solid var(--gray-200);
}

.detail td.rowHeaders {
    font-weight: 600;
    text-align: right;
    color: var(--gray-600);
    background-color: var(--gray-50);
}

/* ============================================
   Cards and Panels
   ============================================ */
.titleHeader {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 1.25rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border: none;
    box-shadow: var(--shadow-sm);
}

.newsHeader {
    font-weight: 600;
    color: var(--gray-700);
    background-color: var(--gray-100);
    padding: 0.875rem 1.25rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.newsDetail {
    padding: 1.25rem;
    background-color: white;
    border: 1px solid var(--gray-200);
    border-top: 0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

#homeNews {
    border: 1px solid var(--gray-200);
    font-weight: 600;
    background-color: var(--gray-100);
    padding: 0.875rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

#homeNews a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

#homeNews a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

#loginInfo {
    border: 1px solid var(--gray-200);
    width: 100%;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 0.875rem;
}

/* ============================================
   Utilities
   ============================================ */
hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   Sidebar Toggled State
   ============================================ */
.admin-wrapper.sidebar-toggled .sidebar {
    transform: translateX(-100%);
}

.admin-wrapper.sidebar-toggled .main-content {
    margin-left: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .admin-wrapper.sidebar-toggled .sidebar {
        transform: translateX(0);
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .topbar-content {
        padding: 0 1rem;
    }
    
    .brand-subtitle {
        display: none;
    }
}

@media (max-width: 576px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .content-area {
        padding: 0.75rem;
    }
    
    input[type="text"],
    input[type="password"],
    select,
    textarea {
        max-width: 100%;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .topbar,
    .content-footer {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-area {
        padding: 0;
    }
}
