:root {
    /* The Vintage Library Palette */
    --primary-color: #546e7a;    /* Slate Blue - Nav & Headers */
    --bg-color: #f5f5f0;         /* Bone - Main Background */
    --text-color: #37474f;       /* Charcoal - Primary Text */
    --accent-color: #81968f;     /* Muted Sage - Truth Filter & Tags */
    --footer-bg: #263238;        /* Deep Slate - Contrast for Footer */
    
    /* --- BOOTSTRAP OVERRIDES --- */
    /* This overrides the default Bootstrap blue (#0d6efd) for pagination globally */
    --bs-pagination-color: var(--primary-color);
    --bs-pagination-hover-color: var(--accent-color);
    --bs-pagination-focus-color: var(--accent-color);
    --bs-pagination-active-bg: var(--primary-color);
    --bs-pagination-active-border-color: var(--primary-color);
    
    /* Override default link color globally */
    --bs-link-color: var(--primary-color);
    --bs-link-hover-color: var(--accent-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Georgia', serif; /* A serif font enhances the "Library" feel */
    line-height: 1.6;
}

.navbar {
    background-color: var(--primary-color) !important;
}

.footer {
    background-color: var(--footer-bg);
    color: #ffffff;
}

.truth-filter-tag {
    background-color: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Custom Scrollbar Hiding for the "Netflix" rows */
.hide-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Hover Effect for Cards */
.hover-shadow:hover {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
    transform: translateY(-2px);
}
.transition {
    transition: all 0.2s ease-in-out;
}

/* Hero Section Background (Optional Gradient) */
.hero-bg {
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
}

/* Sidebar Styling */
.sidebar-card {
    background: #ffffff;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-header {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.sidebar-body {
    padding: 15px;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li a {
    display: block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.sidebar-list li:last-child a {
    border-bottom: none;
}

.sidebar-list li a:hover {
    background-color: #fdfdfd;
    color: var(--accent-color);
    padding-left: 20px; /* Subtle slide effect */
}

.btn-sidebar {
    background-color: var(--accent-color);
    color: white;
    border: none;
    transition: opacity 0.2s;
}

.btn-sidebar:hover {
    opacity: 0.9;
    color: white;
}

/* =========================================
   FLASH MESSAGES (TOAST STYLE)
   ========================================= */

/* 1. The Container - Positions the alerts in the corner */
.flash-toast-container {
    position: fixed;        /* This makes it float over content */
    top: 100px;             /* Distance from top (clears the Navbar) */
    left: 20px;            /* Distance from left edge */
    z-index: 9999;          /* Ensures it sits on top of everything */
    width: 350px;           /* Standard width for readability */
    max-width: 90vw;        /* Prevents overflow on small mobile screens */
    pointer-events: none;   /* Allows clicks to pass through the empty space around alerts */
}

/* 2. The Alert Cards - Visual Styling */
.alert-rft-success, 
.alert-rft-error, 
.alert-rft-info {
    pointer-events: auto;   /* Re-enable clicks so the 'X' button works */
    background-color: #ffffff;
    border: none;
    border-left: 5px solid transparent; /* The colored indicator strip */
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* Drop shadow adds depth */
    margin-bottom: 10px;    /* Spacing between stacked alerts */
    font-family: 'Georgia', serif;
    opacity: 0.98;
}

/* 3. Color Definitions (Matching your theme) */

/* Success: Sage Green */
.alert-rft-success {
    border-left-color: var(--accent-color);
    color: var(--text-color);
}
.alert-rft-success i {
    color: var(--accent-color);
}

/* Error: Burnt Red (High contrast for errors) */
.alert-rft-error {
    border-left-color: #d32f2f;
    color: var(--text-color);
}
.alert-rft-error i {
    color: #d32f2f;
}

/* Info: Slate Blue */
.alert-rft-info {
    border-left-color: var(--primary-color);
    color: var(--text-color);
}
.alert-rft-info i {
    color: var(--primary-color);
}

/* 4. Mobile Responsiveness */
@media (max-width: 768px) {
    .flash-toast-container {
        left: 50%;
        transform: translateX(-50%); /* Centers it horizontally on mobile */
        width: 90%;
        top: 80px;
    }
}

/* =========================================
   USER RAIL
   ========================================= */

.admin-rail {
    background-color: #263238; /* Deep Slate (Footer Color) */
    height: 40px;
    font-size: 0.85rem;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* Clean sans for admin tools */
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.rail-brand {
    color: #81968f; /* Sage Accent */
    font-weight: bold;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.rail-link {
    color: #cfd8dc; /* Light Grey */
    text-decoration: none;
    padding: 0 15px;
    height: 40px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}

.rail-link:hover {
    color: #ffffff;
    background-color: rgba(255,255,255,0.05);
}

.rail-link.active {
    color: #ffffff;
    border-bottom-color: #81968f; /* Sage Green Underline */
    background-color: rgba(255,255,255,0.05);
}

.rail-logout {
    color: #e57373; /* Soft Red */
    transition: color 0.2s;
}

.rail-logout:hover {
    color: #ffcdd2;
}

/* Styling for the Tag Cloud */
.truth-filter-tag {
    background-color: var(--accent-color);
    color: white !important;
    padding: 6px 15px;
    border-radius: 50px; /* Pill shape */
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.truth-filter-tag:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.footer {
    background-color: #ffffff; /* Bone/White to blend with main BG */
    border-top: 1px solid #e0e0e0;
}

.footer a {
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-color) !important;
}

.truth-filter-tag {
    /* Super clean, neutral font stack */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

/* a.btn-sidebar is more specific than just .btn */
a.btn-sidebar:hover,
a.btn-sidebar:focus,
a.btn-sidebar:active {
    background-color: #2c3e50; 
    border-color: #2c3e50;
    color: #ffffff;
    opacity: 1; 
}

/* --- OVERRIDE BOOTSTRAP DEFAULT BLUE --- */
.bg-primary { background-color: var(--primary-color) !important; }
.text-primary { color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }
.btn-primary { background-color: var(--primary-color) !important; border-color: var(--primary-color) !important; color: #fff !important; }
.btn-primary:hover { background-color: #455a64 !important; border-color: #455a64 !important; }
.btn-outline-primary { color: var(--primary-color) !important; border-color: var(--primary-color) !important; }
.btn-outline-primary:hover { background-color: var(--primary-color) !important; color: #fff !important; }
.progress-bar.bg-primary { background-color: var(--primary-color) !important; }
.badge.bg-primary { background-color: var(--primary-color) !important; color: #fff !important; }