/* =========================================================
   COM6011 - US Presidential Interviews Database
   Global Stylesheet
   ========================================================= */
   /* --- Global Stripe Utilities --- */
.stripe-red, .stripe-white, .stripe-blue { height: 100%; }
.stripe-red { background-color: var(--secondary); } /* Red */
.stripe-white { background-color: #ffffff; }
.stripe-blue { background-color: var(--primary); } /* Navy */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    /* Presidential Palette */
    --primary: #002868;       /* Navy Blue (Flag) */
    --secondary: #BF0A30;     /* Old Glory Red (Flag) */
    --accent: #C5A059;        /* Gold (Seal/Accent) */
    
    /* UI Colors */
    --bg-body: #F4F6F8;       /* Off-white background */
    --bg-white: #FFFFFF;
    --text-main: #2C3E50;     /* Dark Grey for text */
    --text-light: #7F8C8D;    /* Muted text */
    --border-color: #E0E0E0;
    
    /* Admin Specific */
    --admin-sidebar-bg: #1a252f;
    --admin-sidebar-text: #ecf0f1;
    
    /* Spacing & Layout */
    --container-width: 1200px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* =========================================================
   RESET & BASE STYLES
   ========================================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Merriweather', serif;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
img { max-width: 100%; display: block; }

/* =========================================================
   LAYOUT UTILITIES
   ========================================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.col { padding: 0 15px; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* Responsive Utilities */
@media (max-width: 768px) {
    .col-6 { flex: 0 0 100%; max-width: 100%; }
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background-color: #001f4d; }

.btn-outline {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background-color: var(--primary); color: white; }

.btn-danger { background-color: var(--secondary); color: white; }
.btn-danger:hover { background-color: #a00826; }

/* =========================================================
   HERO SECTION (index.php)
   ========================================================= */
.hero {
    position: relative;
    min-height: 550px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

/* Flag Background Logic */
.hero-flag-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
}
.flag-stripes {
    height: 100%;
    display: flex;
    flex-direction: column;
}
.flag-stripe { flex: 1; width: 100%; }
.flag-stripe.red { background-color: var(--secondary); }
.flag-stripe.white { background-color: #fff; }
.flag-canton {
    position: absolute;
    top: 0; left: 0;
    width: 40%; height: 54%;
    background-color: var(--primary);
    z-index: -1;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    background: rgba(0, 40, 104, 0.85); /* Dark Blue Overlay */
    padding: 40px 60px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-heading {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.hero-heading em { color: var(--accent); font-style: normal; }

.hero-sub {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
    font-weight: 300;
}

/* =========================================================
   STATS BAR
   ========================================================= */
.stats-bar {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
    border-top: 4px solid var(--accent);
}
.stats-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; opacity: 0.8; }
.stat-divider { color: rgba(255,255,255,0.3); font-size: 1.2rem; }

/* =========================================================
   CARDS & GRIDS (Interviews & Featured)
   ========================================================= */
.section-label {
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
    display: block;
}

/* Featured Section */
.featured-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 30px;
    align-items: flex-start;
    border-left: 5px solid var(--accent);
}
.featured-thumb {
    width: 320px;
    flex-shrink: 0;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.featured-thumb img { width: 100%; transition: transform 0.3s; }
.featured-thumb:hover img { transform: scale(1.05); }
.featured-title { font-size: 1.8rem; margin-bottom: 10px; }
.featured-title a:hover { color: var(--secondary); }
.featured-desc { color: var(--text-light); margin-bottom: 20px; }
.rating-display { margin-bottom: 15px; }
.star { color: #ddd; font-size: 1.2rem; }
.star.filled { color: var(--accent); }
.rating-text { font-size: 0.9rem; color: var(--text-light); margin-left: 10px; }

/* Grid System */
.interviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.interview-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
}
.interview-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.card-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.card-play {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem; color: white; opacity: 0.8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.card-duration {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,0.8); color: white;
    padding: 2px 6px; font-size: 0.75rem; border-radius: 3px;
}

.card-body { padding: 20px; }
.card-network {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    color: var(--secondary); margin-bottom: 8px; display: block;
}
.card-title { font-size: 1.2rem; line-height: 1.3; margin-bottom: 10px; }
.card-title a:hover { color: var(--primary); }
.card-meta { font-size: 0.85rem; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.meta-president { font-weight: 700; color: var(--text-main); }

/* President Pills */
.presidents-strip { background: white; padding: 20px 0; border-bottom: 1px solid var(--border-color); margin-bottom: 40px; }
.president-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
    background: #f0f2f5;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}
.pill:hover { background: var(--primary); color: white; }
.pill-count { opacity: 0.6; font-size: 0.8rem; margin-left: 5px; }

/* Search Input */
.inline-search-input {
    width: 100%; padding: 15px; border: 1px solid var(--border-color);
    border-radius: var(--radius-md); font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
.inline-search-input:focus { border-color: var(--primary); outline: none; }

/* =========================================================
   ADMIN PANEL STYLES (Responsive Fixes)
   ========================================================= */
.admin-wrapper { display: flex; width: 100%; min-height: 100vh; }

/* --- Admin Sidebar (Desktop) --- */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    position: fixed;
    height: 100%; left: 0; top: 0;
    overflow-y: auto;
    z-index: 100;
}
.admin-brand {
    padding: 25px 20px;
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    color: var(--accent);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-nav ul { list-style: none; padding: 0; }
.admin-nav a {
    display: block; padding: 15px 25px; color: #bdc3c7;
    border-left: 4px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--accent);
}

/* --- Admin Content (Desktop) --- */
.admin-content { margin-left: 260px; flex: 1; padding: 30px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.admin-title { font-size: 2rem; margin: 0; font-family: 'Merriweather', serif; }

/* --- Stats Cards --- */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.admin-stat-card {
    background: white; padding: 20px; border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); text-align: center;
    border-top: 4px solid var(--primary);
}
.admin-stat-num { font-size: 2.5rem; font-weight: 700; color: var(--text-main); }

/* --- Admin Tables (The Fix) --- */
.admin-section { background: white; padding: 25px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 30px; }

/* This wrapper handles the scrolling on mobile */
.table-responsive {
    overflow-x: auto;
    display: block; /* Ensures wrapper takes full width */
    width: 100%;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
}

.admin-table { 
    width: 100%; 
    border-collapse: collapse;
    min-width: 600px; /* Force minimum width so it scrolls instead of squishing */
}
.admin-table th, .admin-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; white-space: nowrap; }
.admin-table th { background: #f8f9fa; color: var(--text-main); font-weight: 600; text-transform: uppercase; font-size: 0.85rem; }
.admin-table tr:hover { background: #f1f1f1; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-main); }
.form-control {
    width: 100%; padding: 10px; border: 1px solid var(--border-color);
    border-radius: var(--radius-sm); font-size: 1rem;
}
.form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(0,40,104,0.1); }

/* --- Action Buttons --- */
.action-btn { padding: 5px 10px; border-radius: 4px; text-decoration: none; font-size: 0.8rem; color: white; display: inline-block; margin-right: 5px; }
.action-edit { background-color: var(--accent); }
.action-delete { background-color: var(--secondary); }


/* =========================================================
   ADMIN RESPONSIVE (Mobile & Tablet)
   ========================================================= */

/* Tablet Adjustments */
@media (max-width: 992px) {
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    
    /* 1. Sidebar collapses to icons */
    .admin-sidebar { width: 60px; }
    .admin-content { margin-left: 60px; padding: 15px; }
    
    .admin-brand span, .admin-nav span { display: none; } /* Hide text */
    .admin-nav a { padding: 15px 0; text-align: center; }
    
    /* 2. Stats stack vertically */
    .admin-stats { grid-template-columns: 1fr; }
    
    /* 3. Header stacks */
    .admin-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .admin-header .btn { width: 100%; text-align: center; }
    
    /* 4. Table scrolls horizontally */
    /* (The CSS above handles this, ensuring .table-responsive has overflow-x) */
    
    /* 5. Forms stack */
    .row { flex-direction: column; gap: 10px; }
    .col { width: 100%; }
}
/* =========================================================
   PROFILE PAGE STYLES (president.php)
   ========================================================= */
.profile-header {
    background: linear-gradient(135deg, var(--primary), #0033a0);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}
.profile-container { display: flex; align-items: center; gap: 30px; }
.profile-img-placeholder {
    width: 150px; height: 150px; background: white;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 3rem; color: var(--primary);
    border: 4px solid var(--accent); flex-shrink: 0;
}
.profile-info h1 { color: white; margin-bottom: 10px; font-size: 2.2rem; }
.party-badge-lg { background: var(--secondary); color: white; padding: 5px 12px; border-radius: 4px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.bio-text { max-width: 600px; margin-top: 20px; font-size: 1.05rem; opacity: 0.9; }
/* =========================================================
   SITE HEADER & NAVIGATION (includes/header.php)
   ========================================================= */
.site-header {
    background-color: var(--primary); /* Navy Blue */
    color: var(--bg-white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Branding */
.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.brand-stars {
    color: var(--accent); /* Gold */
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
}

.brand-sub {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* Navigation (Desktop) */
.main-nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.nav-admin {
    color: var(--accent) !important; /* Admin link always gold */
}

/* Mobile Hamburger Button */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background: var(--bg-white);
    border-radius: 10px;
    transition: all 0.3s linear;
}

/* The Stripe Bar */
.header-stripe {
    height: 5px;
    width: 100%;
    display: flex;
}

.stripe-red, .stripe-white, .stripe-blue {
    height: 100%;
}

.stripe-red { flex: 1; background-color: var(--secondary); }
.stripe-white { flex: 2; background-color: #ffffff; }
.stripe-blue { flex: 1; background-color: var(--primary); }

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 80px; /* Below header */
    right: 20px;
    width: 300px;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.flash-success { background-color: #27ae60; border-left: 5px solid #1e8449; }
.flash-error { background-color: #c0392b; border-left: 5px solid #922b21; }

.flash-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 10px;
}

/* Responsive Header Styles */
@media (max-width: 768px) {
    .header-inner { padding: 10px 15px; }
    
    .nav-toggle { display: flex; }
    
    /* Mobile Menu Styling */
    .main-nav {
        display: none; /* Hidden by default */
        position: absolute;
        top: 100%; /* Push below header */
        left: 0;
        width: 100%;
        background-color: var(--primary);
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    /* When the class 'open' is added via JS */
    .main-nav.open {
        display: flex;
    }

    .nav-link {
        padding: 15px 20px;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .nav-link:hover { background-color: rgba(255,255,255,0.1); }
    
    .brand-title { font-size: 1.1rem; }
    .brand-sub { font-size: 0.65rem; }
}
/* =========================================================
   SITE FOOTER (includes/footer.php)
   ========================================================= */
.site-footer {
    background-color: var(--primary);
    color: white;
    padding-bottom: 40px;
    margin-top: 60px;
}

/* The decorative stripe at the top */
.footer-stripe {
    height: 5px;
    width: 100%;
    display: flex;
    margin-bottom: 40px;
}
/* If using global stripe utilities, the widths are set here specifically for the footer if desired */
.footer-stripe .stripe-red { flex: 1; }
.footer-stripe .stripe-white { flex: 2; }
.footer-stripe .stripe-blue { flex: 1; }

.footer-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* Branding Section */
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.brand-stars {
    color: var(--accent); /* Gold */
    font-size: 1rem;
    letter-spacing: 2px;
}

/* Description */
.footer-sub {
    font-family: 'Source Sans 3', sans-serif;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

/* Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Copyright */
.footer-copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin: 0;
}

/* Responsive Footer */
@media (max-width: 600px) {
    .footer-brand { font-size: 1.1rem; }
    .footer-links { gap: 15px; }
    .footer-links a { font-size: 0.75rem; }
    .brand-stars { font-size: 0.8rem; }
}