/* Minimalist & Modern Styles */

:root {
    --primary: #334155;
    --accent: #3b82f6;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Proposal Card Styling */
.party-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.proposal-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.proposal-card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Category Item Hover State (Sidebar) */
.category-item {
    transition: all 0.2s ease;
}

.category-item:hover {
    background-color: #f8fafc;
    padding-left: 1rem;
}

.category-item.active {
    background-color: #f1f5f9;
    color: #1e293b;
    font-weight: 600;
    border-left: 3px solid #3b82f6;
    padding-left: 1rem;
}

/* Category Navigation (Top Pills) */
.category-pill {
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-pill.active {
    background-color: #1e293b;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.quote-section {
    transition: max-height 0.3s ease-out;
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    aside {
        display: none !important;
    }

    header {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    header > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    header > div > div:last-child {
        align-self: flex-end !important;
        margin-top: 0.5rem !important;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    .proposal-card {
        padding: 1.5rem !important;
    }

    .mobile-hidden {
        display: none !important;
    }
}

@media (max-width: 640px) {
    header {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    header > div > div:last-child {
        margin-top: 0.75rem !important;
    }

    #btn-back {
        font-size: 0.875rem !important;
        padding: 0.5rem 0.75rem !important;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Comparison View Styles */
.contrast-grid {
    display: block;
}

.party-comparison-col {
    display: none;
}

.party-comparison-col.mobile-active {
    display: block;
}

/* Mobile Party Tab Switcher */
.party-tab-switcher {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.party-tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
    background: white;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.party-tab-btn.tab-active {
    color: white;
    border-color: transparent;
}

/* Enhanced Mobile Comparison Styles */
.mobile-comparison-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(255,255,255,0.95));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.mobile-party-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mobile-party-indicator .current-party {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #1e293b;
}

.mobile-party-indicator .party-counter {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

/* Swipe hint animation */
.swipe-hint {
    position: relative;
    overflow: hidden;
}

.swipe-hint::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Mobile comparison actions */
#mobile-comparison-actions {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

#mobile-comparison-actions.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced party card for mobile comparison */
.party-comparison-col {
    position: relative;
}

.party-comparison-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--party-color, #cbd5e1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.party-comparison-col.mobile-active::before {
    opacity: 1;
}

/* Mobile swipe indicators */
.swipe-indicator {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.swipe-indicator.show {
    opacity: 1;
}

/* Split-screen comparison mode */
.split-screen-mode .contrast-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
}

.split-screen-mode .party-comparison-col {
    display: block !important;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    padding: 1rem;
}

.split-screen-mode .party-comparison-col.mobile-active {
    border: 2px solid var(--party-color);
    box-shadow: 0 0 0 3px var(--party-color20);
}

.split-screen-mode .party-tab-switcher {
    display: none;
}

.split-screen-mode #mobile-comparison-actions {
    display: none;
}

.split-screen-mode #split-screen-toggle {
    display: none;
}

.split-screen-mode .proposal-card {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem;
}

.split-screen-mode .proposal-card h4 {
    font-size: 0.9rem !important;
    line-height: 1.3;
}

.split-screen-mode .proposal-card p {
    font-size: 0.8rem !important;
    line-height: 1.4;
    margin-bottom: 0.5rem !important;
}

.split-screen-mode .party-indicator {
    height: 2px;
}

/* Split-screen toggle button */
#btn-toggle-split.active {
    background: #1e293b;
    color: white;
    border-color: #1e293b;
}

/* Party header in split-screen */
.split-screen-header {
    display: none;
    position: sticky;
    top: 0;
    background: white;
    padding: 0.5rem;
    margin: -1rem -1rem 0.5rem -1rem;
    border-bottom: 1px solid #e2e8f0;
    z-index: 10;
}

.split-screen-mode .split-screen-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: #1e293b;
}

.split-screen-header img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Responsive adjustments for split-screen */
@media (max-width: 640px) {
    .split-screen-mode .contrast-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .split-screen-mode .party-comparison-col {
        max-height: none;
    }
}

@media (min-width: 1024px) {
    .contrast-grid {
        display: grid;
        grid-template-columns: repeat(var(--cols, 2), 1fr);
        gap: 2rem;
    }

    .party-comparison-col {
        display: block;
    }

    .party-tab-switcher {
        display: none;
    }
}

.party-pill {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.party-pill.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.filter-btn.active {
    background-color: #0f172a;
    color: white;
    border-color: #0f172a;
}

.topic-card {
    transition: all 0.3s ease;
}

.topic-card.active {
    border-color: transparent;
    background: #0f172a;
    color: white;
    transform: translateY(-2px);
}

.topic-card.active i {
    color: #38bdf8;
}

/* Party border indicator */
.party-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0.75rem 0 0 0.75rem; /* Match rounded-2xl */
    z-index: 1;
}

/* Floating Category Button */
#floating-category-btn {
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#floating-category-btn:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#category-dropdown {
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.category-dropdown-item {
    transition: all 0.2s ease;
}

.category-dropdown-item:hover {
    padding-left: 1.25rem;
}