/* public/css/style.css */

/* --- IMPORT COMPONENT STYLES --- */
@import url('./components/_buttons.css');
@import url('./components/_dashboard.css');
@import url('./components/_loaders.css'); 
@import url('./components/_media-library.css');
@import url('./components/_modals.css');
@import url('./components/_scheduler.css');
@import url('./components/_tables.css');
@import url('./components/_toast.css');


:root {
    --bg-dark: #121212;
    --bg-light: #1E1E1E;
    --bg-lighter: #2a2a2a;
    --border-color: #333333;
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --danger-color: #EF4444;
    --danger-hover: #DC2626;
    --text-main: #E5E7EB;
    --text-muted: #9CA3AF;
    --green-status: #10B981;
    --font-family: 'Inter', sans-serif;
}

body.light-mode {
    --bg-dark: #F3F4F6;
    --bg-light: #FFFFFF;
    --bg-lighter: #F9FAFB;
    --border-color: #E5E7EB;
    --text-main: #1F2937;
    --text-muted: #6B7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999; /* Below sidebar */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- LOGIN PAGE STYLES --- */
.login-page-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { text-align: center; padding: 16px; }
.login-box { background-color: var(--bg-light); padding: 48px; border-radius: 16px; border: 1px solid var(--border-color); }
.login-box .sidebar-header { justify-content: center; }
.login-box p { margin-top: -30px; margin-bottom: 30px; color: var(--text-muted); }
.btn-google { display: inline-flex; align-items: center; gap: 12px; padding: 12px 24px; background-color: #FFF; color: #333; border: 1px solid #CCC; border-radius: 8px; font-weight: 600; font-size: 16px; cursor: pointer; transition: all 0.2s ease; }
.btn-google:hover { background-color: #f7f7f7; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.login-error-message { color: var(--danger-color); margin-top: 16px; height: 20px; font-weight: 500; }

/* --- MAIN LAYOUT --- */
.dashboard-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background-color: var(--bg-light);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    height: 100%;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    display: grid;
    grid-template-rows: auto 1fr; 
    height: 100vh;
    padding: 32px;
}

/* --- SIDEBAR --- */
.sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 40px; }
.sidebar-header .logo-wrapper { display: flex; align-items: center; gap: 12px; }
.sidebar-header .logo-icon { font-size: 28px; color: var(--primary-color); }
.sidebar-header .logo-wrapper img, .logo-img, .logo img { width: 36px !important; height: 36px !important; max-width: 36px !important; max-height: 36px !important; border-radius: 50% !important; object-fit: cover !important; flex-shrink: 0 !important; }
.sidebar-header h1 { font-size: 22px; font-weight: 700; }
.sidebar-nav ul { list-style-type: none; }
.sidebar-nav a { display: flex; align-items: center; gap: 16px; padding: 12px 16px; text-decoration: none; color: var(--text-muted); font-weight: 500; border-radius: 8px; transition: all 0.2s ease; margin-bottom: 4px; }
.sidebar-nav a:hover { background-color: var(--bg-lighter); color: var(--text-main); }
.sidebar-nav a.active { background-color: var(--primary-color); color: #FFF; }
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-close-btn { font-size: 24px; color: var(--text-muted); cursor: pointer; display: none; }

/* --- SIDEBAR FOOTER --- */
.sidebar-footer { border-top: 1px solid var(--border-color); padding-top: 16px; }
.user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; }
.user-info .name { font-weight: 600; font-size: 14px; }
.sidebar-footer-actions { display: flex; justify-content: space-between; align-items: center; }
.logout-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-muted); font-weight: 500; border-radius: 8px; transition: all 0.2s ease; padding: 8px; }
.logout-link:hover { color: var(--danger-color); }
.theme-toggle { background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 50px; padding: 4px; cursor: pointer; display: flex; }
.theme-toggle .icon { font-size: 16px; padding: 4px; color: var(--text-muted); }
.theme-toggle .icon.sun { display: none; }
body.light-mode .theme-toggle .icon.sun { display: block; }
body.light-mode .theme-toggle .icon.moon { display: none; }

/* --- MAIN CONTENT HEADER --- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px; 
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.content-header h2 {
    font-size: 28px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-toggle {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
}

.page { 
    display: none; 
    animation: fadeIn 0.5s ease;
    overflow: auto; 
}

.date-mobile {
    display: none; /* Hide mobile date on desktop by default */
}

.page.active { 
    display: block; 
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ========================================================= */
/* ---                  RESPONSIVE STYLES                  --- */
/* ========================================================= */

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-close-btn { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
}

@media (max-width: 768px) {
    .main-content { padding: 24px; }
    .content-header h2 { font-size: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .scheduler-controls { flex-direction: column; align-items: stretch; gap: 16px; }
    .scheduler-nav { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .scheduler-nav h3 { font-size: 16px; }
    .scheduler-view-options { margin-left: 0; width: 100%; justify-content: space-between; }
    .form-group-row { flex-direction: column; gap: 0; }
    .header-actions .btn .btn-text { display: none; }
    .date-desktop {
        display: none; /* Hide desktop date on mobile */
    }
    .date-mobile {
        display: inline; /* Show mobile date on mobile */
    }
}

@media (max-width: 480px) {
    .main-content { padding: 16px; }
    .content-header { margin-bottom: 24px; }
    .header-actions .btn { padding: 8px 12px; font-size: 13px; }
    .login-box { padding: 32px 24px; }
    .modal-content { padding: 24px; }
}

/* ========================================================= */
/* ---           FIX: CUSTOM SCROLLBAR STYLES              --- */
/* ========================================================= */

/* For Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) var(--bg-dark);
}

/* For Chrome, Safari, and Edge */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background-color: var(--text-muted);
  border-radius: 10px;
  border: 2px solid var(--bg-dark);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-color);
}

/* License Warning Banner */
.license-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    color: #fca5a5;
    margin: 16px 0 24px 0;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
    animation: bannerFadeIn 0.3s ease;
}

.license-banner.hidden {
    display: none !important;
}

.license-banner i {
    font-size: 1.6rem;
    color: #ef4444;
}

.license-banner .banner-text strong {
    display: block;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 2px;
}

.license-banner .banner-text span {
    font-size: 0.85rem;
    color: #fca5a5;
}

@keyframes bannerFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}