:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    
    /* Brand Colors */
    --tag-renault: #f59e0b;
    --tag-toyota: #ef4444;
    --tag-jeep: #10b981;
    --tag-stellantis: #6366f1;
    --tag-byd: #0ea5e9;
    --tag-geely: #ec4899;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Glassmorphism Background Orbs */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #8b5cf6;
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Header */
header {
    padding: 4rem 2rem 2rem;
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

h1 span {
    color: var(--accent);
}

header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filters */
.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* News Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s forwards ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.2);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    letter-spacing: 1px;
}

.date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card h2 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    text-decoration: none;
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    padding: 0.8rem 0;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.read-more:hover {
    background: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Tag Colors */
.tag-renault { background: rgba(245, 158, 11, 0.15); color: var(--tag-renault); }
.tag-toyota { background: rgba(239, 68, 68, 0.15); color: var(--tag-toyota); }
.tag-jeep { background: rgba(16, 185, 129, 0.15); color: var(--tag-jeep); }
.tag-stellantis { background: rgba(99, 102, 241, 0.15); color: var(--tag-stellantis); }
.tag-byd { background: rgba(14, 165, 233, 0.15); color: var(--tag-byd); }
.tag-geely { background: rgba(236, 72, 153, 0.15); color: var(--tag-geely); }
.tag-default { background: rgba(255, 255, 255, 0.1); color: var(--text-main); }

.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Custom Dropdown */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 250px;
    z-index: 20;
}
.custom-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-family: 'Outfit';
    font-weight: 600;
    cursor: pointer;
}
.custom-select img, .custom-option img {
    width: 20px;
    height: auto;
    margin-right: 10px;
    vertical-align: middle;
}
.custom-options {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    z-index: 10;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.custom-options.open {
    display: block;
}
.custom-option {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}
.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* AI Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open {
    display: flex;
}
.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
    position: relative;
    animation: zoomIn 0.3s ease-out;
}
@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}
.modal-header h2 {
    font-size: 1.3rem;
    color: var(--text-main);
}
.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover {
    color: var(--text-main);
}
.modal-body p {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 1.05rem;
}

.ai-summary-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    color: white;
    padding: 0.8rem 1.2rem;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
}
.ai-summary-btn:hover {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}
.card .read-more {
    flex: 1;
}

/* FAB Button */
.fab-btn {
    position: fixed;
    bottom: 80px;
    right: 30px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.4);
    z-index: 101;
    transition: all 0.3s ease;
}
.fab-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.6);
}

/* Brand Selection Checkboxes */
.brand-checkbox, .country-checkbox {
    display: none;
}
.brand-label {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}
.brand-label::before {
    content: "+";
    font-weight: bold;
    font-size: 1.1rem;
    opacity: 0.7;
}
.brand-checkbox:checked + .brand-label, .country-checkbox:checked + .brand-label {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}
.brand-checkbox:checked + .brand-label::before, .country-checkbox:checked + .brand-label::before {
    content: "✓";
}
