/* Root Variables - UK Flag Colors */
:root {
    --primary-color: #00247D; /* Royal Blue from UK Flag */
    --secondary-color: #CF142B; /* Flag Red from UK Flag */
    --uk-white: #FFFFFF; /* UK Flag White */
    --text-color: #2c3e50;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0, 36, 125, 0.12);
    --shadow-hover: 0 4px 12px rgba(0, 36, 125, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #002f6c 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.uk-flag {
    width: 80px;
    height: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* UK Separator */
.uk-separator {
    height: 4px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--uk-white) 33%, var(--secondary-color) 66%, var(--uk-white) 100%);
    margin: 1.5rem 0;
}

/* Intro Section */
.intro {
    background: var(--card-bg);
    padding: 1.5rem;
    margin: 1.5rem 0 1rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--secondary-color);
}

.intro p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Info Sections Container */
.info-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

/* Context Box */
.context-box {
    background: var(--card-bg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--primary-color);
}

.context-box h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.leader-card {
    background: #f8f9fa;
    padding: 1rem;
    text-align: center;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.leader-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 36, 125, 0.15);
}

.leader-card img {
    width: 100%;
    max-width: 120px;
    height: 140px;
    object-fit: cover;
    margin-bottom: 0.75rem;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.leader-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.leader-info p {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.party-logo {
    max-width: 60px !important;
    height: auto !important;
    max-height: 30px;
    object-fit: contain !important;
    border: none !important;
    margin: 0.5rem auto 0 !important;
    display: block;
}

/* CPS Resources Section */
.cps-resources {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--secondary-color);
}

.cps-resources h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.cps-intro {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-style: italic;
}

.cps-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cps-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    text-decoration: none;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.cps-link:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(207, 20, 43, 0.2);
    border-color: var(--secondary-color);
}


.cps-link-content h4 {
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.cps-link-content p {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.3;
}

/* Arrest Data Section */
.arrest-data-section {
    background: var(--card-bg);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    border: 2px solid var(--secondary-color);
}

.arrest-data-section h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    text-align: center;
    font-weight: 600;
}

.data-intro {
    text-align: center;
    color: #6c757d;
    margin-bottom: 2rem;
    font-style: italic;
}

.data-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: #f8f9fa;
    padding: 1.5rem;
    border: 1px solid #e0e0e0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-container h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.chart {
    height: 200px;
    background: white;
    border: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-style: italic;
}

.chart-bars {
    display: flex;
    align-items: end;
    justify-content: space-around;
    height: 100%;
    padding: 1rem;
    gap: 0.5rem;
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
}

.chart-bar {
    background: linear-gradient(to top, var(--secondary-color) 0%, #ff4757 100%);
    width: 100%;
    min-height: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    transform: scaleY(1.05);
    box-shadow: 0 2px 8px rgba(207, 20, 43, 0.3);
}

.bar-value {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.bar-label {
    margin-top: 1.5rem;
    font-size: 0.7rem;
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

.chart-total {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.data-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #003a8c 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.big-number {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.summary-card p:last-child {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
}

.data-source {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.data-source p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.data-source a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.data-source a:hover {
    text-decoration: underline;
}

/* Controls Section */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sort-controls label {
    font-weight: 600;
    color: var(--text-color);
}

.sort-dropdown {
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-dropdown:hover {
    background: var(--primary-color);
    color: white;
}

.sort-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(1, 33, 105, 0.2);
}

/* Feed */
.feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 3rem 0;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: #666;
}

/* Content Cards - Compact & Minimalist */
.content-card {
    background: var(--card-bg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 450px; /* Fixed height for all cards */
}

.content-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.content-card.hidden {
    display: none;
}

.card-header {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 42px;
}

.card-type {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-date {
    font-size: 0.75rem;
    opacity: 0.9;
}

.card-metadata {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #6c757d;
    min-height: 38px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metadata-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

.card-body {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden; /* Prevent content overflow */
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em;
}

.card-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Reduced to 2 lines for consistency */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 3em; /* Reduced height */
    flex-shrink: 0;
}

/* Video Embed - Compact */
.video-container {
    position: relative;
    height: 200px; /* Fixed height for all video containers */
    overflow: hidden;
    background: #000;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover; /* Ensures video fills container properly */
}

/* YouTube Shorts - Fixed height to match other cards */
.short-container {
    height: 200px; /* Same height as regular videos */
    max-width: 200px; /* Narrower width for vertical content */
    margin-left: auto;
    margin-right: auto;
}

/* Article Link - Compact */
.article-link {
    display: block;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.article-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer - Comprehensive */
footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
}

.footer-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-content h4 {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    color: white;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

.footer-description {
    line-height: 1.7;
    margin-bottom: 1.5rem;
    opacity: 0.95;
    font-size: 1rem;
}

.footer-disclaimer {
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
    font-size: 0.95rem;
}

.footer-disclaimer strong {
    color: var(--secondary-color);
    font-weight: 600;
}

.footer-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-links p {
    margin: 0.5rem 0;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .uk-flag {
        width: 60px;
    }
    
    .header-text {
        text-align: center;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .info-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .leadership-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .leader-card {
        padding: 0.75rem;
    }
    
    .leader-card img {
        max-width: 100px;
        height: 120px;
    }
    
    .context-box h3 {
        font-size: 1.1rem;
    }
    
    .cps-resources h3 {
        font-size: 1.1rem;
    }
    
    .cps-link {
        padding: 0.75rem;
    }
    
    .cps-icon {
        font-size: 1.5rem;
    }
    
    .data-charts {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .data-summary {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .big-number {
        font-size: 1.5rem;
    }
    
    .arrest-data-section {
        padding: 1.5rem;
    }
    
    .feed {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filters {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .sort-controls {
        justify-content: center;
    }
    
    .card-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
    
    .intro {
        padding: 1rem;
    }
    
    footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-content h3 {
        font-size: 1.25rem;
    }
    
    .footer-content h4 {
        font-size: 1.1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card {
    animation: fadeIn 0.5s ease-out;
}


