/* ============================================
   CSS Reset and Base Styles
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f4c75;
    --highlight-color: #3282b8;
    --text-dark: #1a1a2e;
    --text-light: #666;
    --text-muted: #999;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Crimson Pro', Georgia, serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Container */
    --container-width: 1200px;
}

/* ============================================
   Cookie popup removed - not needed
   ============================================ */

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent body scroll when overlay is open */
body.overlay-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--highlight-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.bg-light {
    background: var(--bg-light);
}

.bg-dark {
    background: var(--bg-dark);
    color: var(--bg-white);
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    background: var(--bg-dark);
    color: var(--bg-white);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar-container {
    max-width: 1400px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.4rem;
    color: var(--bg-white);
    margin: 0;
    white-space: nowrap;
}

.nav-menu {
    list-style: none;
    gap: var(--spacing-sm);
    margin: 0;
    display: none; /* Hidden by default on mobile */
}

/* Desktop: show menu */
@media (min-width: 769px) {
    .nav-menu {
        display: flex;
    }
}

.nav-menu a {
    color: var(--bg-white);
    font-weight: 500;
    font-size: 0.95rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 4px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   VS Banner Section
   ============================================ */

.vs-banner {
    background: var(--bg-white);
    padding: var(--spacing-lg) 0;
    border-bottom: 3px solid var(--accent-color);
}

.vs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.vs-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-left h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    text-align: center;
    margin: 0;
}

.vs-middle {
    flex: 0 0 auto;
    padding: 0 var(--spacing-md);
}

.vs-middle h1 {
    font-size: 4rem;
    color: var(--text-dark);
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.1em;
}

.vs-right {
    flex: 1;
}

.vs-images {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    align-items: center;
}

.vs-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent-color);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .vs-container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .vs-left h2 {
        font-size: 2rem;
    }

    .vs-middle h1 {
        font-size: 3rem;
    }

    .vs-photo {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .vs-left h2 {
        font-size: 1.5rem;
    }

    .vs-middle h1 {
        font-size: 2rem;
    }

    .vs-photo {
        width: 80px;
        height: 80px;
    }

    .vs-images {
        gap: var(--spacing-sm);
    }
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: var(--bg-white);
    padding: var(--spacing-xl) 0;
    text-align: center;
}

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

.hero h1 {
    font-size: 3.5rem;
    color: var(--bg-white);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero .lead {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: var(--spacing-sm);
    opacity: 0.95;
}

/* ============================================
   Content Boxes
   ============================================ */

.content-box {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-md);
}

.content-box h3 {
    color: var(--accent-color);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.content-box h3:first-child {
    margin-top: 0;
}

.highlight-box {
    background: #fff3cd;
    border-left: 5px solid #ff6b6b;
    padding: var(--spacing-md);
    border-radius: 4px;
    margin: var(--spacing-md) 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.quote-box {
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    padding: var(--spacing-md);
    border-radius: 4px;
    margin: var(--spacing-md) 0;
    font-style: italic;
}

.quote-box p {
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-box ul {
    margin-left: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.content-box ul li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.7;
}

.intro {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
    position: relative;
    max-width: 900px;
    margin: var(--spacing-md) auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: var(--spacing-lg);
}

.timeline-item.highlight .timeline-content {
    background: #fff3cd;
    border-left: 4px solid #ff6b6b;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--highlight-color);
    border: 3px solid var(--bg-white);
    box-shadow: 0 0 0 3px var(--accent-color);
}

.timeline-content {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.timeline-time {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
}

.timeline-content h3 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
}

.quote {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-dark);
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-left: 4px solid var(--accent-color);
    margin: var(--spacing-sm) 0;
    font-family: var(--font-heading);
}

.description {
    color: var(--text-light);
    line-height: 1.7;
}

/* ============================================
   Evidence Section
   ============================================ */

.evidence-item {
    margin-bottom: var(--spacing-xl);
}

.evidence-item h3 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
}

.evidence-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

.evidence-display {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.evidence-image {
    width: 100%;
    margin-bottom: var(--spacing-md);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.evidence-image:last-child {
    margin-bottom: 0;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.evidence-grid-item {
    display: flex;
    flex-direction: column;
}

.evidence-grid-item h4 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-primary);
    font-weight: 600;
}

.evidence-image-small {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow);
    object-fit: contain;
}

.pdf-embed-small {
    width: 100%;
    min-height: 450px;
}

.pdf-embed-small embed {
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.pdf-embed {
    width: 100%;
    min-height: 600px;
}

.pdf-embed embed {
    border-radius: 4px;
}

.pdf-embed .fallback {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg-light);
    margin-top: var(--spacing-sm);
}

.video-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-container video {
    width: 100%;
    display: block;
}

/* iMessage Grid */
.imessage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.imessage-item {
    background: var(--bg-white);
    padding: var(--spacing-md);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.imessage-item h4 {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-primary);
    font-weight: 600;
}

.imessage-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow);
    object-fit: contain;
    margin-bottom: var(--spacing-sm);
}

.imessage-item p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   Email Display
   ============================================ */

.email-container {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-primary);
}

.email-header {
    background: var(--bg-light);
    padding: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.95rem;
}

.email-header p {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
}

.email-header strong {
    display: inline-block;
    min-width: 60px;
    color: var(--text-dark);
}

.email-body {
    padding: var(--spacing-md);
    line-height: 1.8;
    font-size: 1rem;
}

.email-body p {
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   Defendants Section
   ============================================ */

.defendants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.defendant-card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.defendant-card:hover {
    transform: translateY(-5px);
}

.defendant-photo {
    width: 100%;
    height: 300px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.party-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.photo-placeholder {
    color: var(--text-muted);
    font-size: 1.1rem;
    text-align: center;
    padding: var(--spacing-md);
}

.defendant-info {
    padding: var(--spacing-md);
}

.defendant-info h3 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-xs);
}

.defendant-info .title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.defendant-info .bar-number {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.bio p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

/* ============================================
   Bar Rules / Violations Section
   ============================================ */

.violation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.violation-card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: var(--spacing-md);
    border-top: 4px solid var(--accent-color);
}

.violation-card h3 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
}

.rule-text {
    background: var(--bg-light);
    padding: var(--spacing-sm);
    border-radius: 4px;
    margin-bottom: var(--spacing-md);
}

.rule-text strong {
    color: var(--text-dark);
}

.violation-analysis {
    margin-top: var(--spacing-sm);
}

.violation-analysis strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: var(--spacing-xs);
}

.violation-analysis ul {
    list-style-position: inside;
    padding-left: var(--spacing-sm);
}

.violation-analysis li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.7;
    color: var(--text-light);
}

.disclaimer {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.disclaimer strong {
    color: var(--text-dark);
}

/* ============================================
   Footer
   ============================================ */

.footer {
    background: var(--bg-dark);
    color: var(--bg-white);
    padding: var(--spacing-lg) 0;
    text-align: center;
}

.footer-content p {
    margin-bottom: var(--spacing-xs);
    opacity: 0.9;
}

.footer-content .contact {
    font-weight: 600;
    margin-top: var(--spacing-sm);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    .hero h1 {
        font-size: 2.5rem;
    }

    .navbar .container,
    .navbar-container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .nav-brand h1 {
        font-size: 1.2rem;
        text-align: center;
    }

    .nav-menu {
        flex-direction: column;
        gap: var(--spacing-xs);
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        text-align: center;
        font-size: 0.9rem;
    }

    .defendants-grid {
        grid-template-columns: 1fr;
    }

    .violation-grid {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-marker {
        left: 1px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    /* Tab Overlay Mobile Styles */
    .tab-content-container {
        width: 95%;
        max-height: 95vh;
        padding: var(--spacing-md);
    }

    .tab-close-btn {
        top: 10px;
        right: 15px;
        font-size: 2.5rem;
    }

    .tab-panel h2 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-sm);
    }

    .tab-panel h3 {
        font-size: 1.2rem;
    }

    /* Feedback Summary Mobile */
    .feedback-summary {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .feedback-stat {
        justify-content: center;
        width: 100%;
        padding: 0.75rem;
    }

    /* Feedback List Mobile - still uses flex: 1 */
    .feedback-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .feedback-vote {
        font-size: 0.85rem;
    }

    .feedback-comment {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .quote {
        font-size: 1rem;
    }

    /* Extra Small Screen Tab Overlay */
    .tab-content-container {
        width: 98%;
        max-height: 98vh;
        padding: 1rem;
    }

    .tab-panel h2 {
        font-size: 1.3rem;
    }

    .tab-panel h3 {
        font-size: 1.1rem;
    }

    .tab-panel p {
        font-size: 0.9rem;
    }

    .tab-panel li {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Feedback Stats Mobile */
    .feedback-stat-count {
        font-size: 1.3rem;
    }

    .feedback-stat-text {
        font-size: 0.7rem;
    }

    .feedback-stat-icon {
        font-size: 1rem;
    }
}

/* ============================================
   Tab Overlay System
   ============================================ */

.tab-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10002;
    overflow-y: auto;
}

.tab-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-content-container {
    background: var(--bg-white);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden !important; /* Never scroll the container itself */
    border-radius: 8px;
    padding: var(--spacing-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.tab-close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1;
    transition: color 0.3s ease;
}

.tab-close-btn:hover {
    color: var(--accent-color);
}

.tab-panel {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.tab-panel.active {
    display: flex;
}

.tab-panel h2 {
    color: var(--accent-color);
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.tab-panel > p {
    flex-shrink: 0;
}

.tab-panel .terms-content > p:first-child {
    flex-shrink: 0;
}

.tab-panel h3 {
    color: var(--accent-color);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.tab-panel ol {
    margin-left: 2rem;
    margin-top: var(--spacing-sm);
    overflow-y: auto;
}

.tab-panel li {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.tab-panel .warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin: 2rem 0;
}

.tab-panel .warning strong {
    color: #856404;
}

/* Feedback Header: Stats and Sort side by side */
.feedback-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
}

/* Feedback Summary */
.feedback-summary {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 4px;
    flex: 1;
}

/* Feedback Sort Controls */
.feedback-sort {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    flex-shrink: 0;
}

.feedback-sort label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feedback-sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--bg-white);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.feedback-sort-select:hover {
    border-color: var(--accent-color);
}

.feedback-sort-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.feedback-stat {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
}

.feedback-stat.total {
    background: #e7f3ff;
    border: 2px solid var(--accent-color);
}

.feedback-stat.for {
    background: #d4edda;
    border: 2px solid #28a745;
}

.feedback-stat.against {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.feedback-stat-icon {
    font-size: 1.5rem;
}

.feedback-stat-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feedback-stat-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Feedback List Styles */
.feedback-list {
    margin-top: var(--spacing-sm);
    flex: 1;
    overflow-y: auto !important;
    padding-right: 0.5rem;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    min-height: 0; /* Important for flex scrolling */
    max-height: 100%; /* Prevent overflow of parent */
}

/* Custom Scrollbar */
.feedback-list::-webkit-scrollbar {
    width: 8px;
}

.feedback-list::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.feedback-list::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.feedback-list::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

/* Tab overlay scrolling */
.tab-content-container {
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Terms content scrolling */
.terms-content {
    flex: 1;
    overflow-y: auto !important;
    padding-right: 0.5rem;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    max-height: 100%; /* Prevent overflow of parent */
}

.terms-content::-webkit-scrollbar {
    width: 8px;
}

.terms-content::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.terms-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.terms-content::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color);
}

.feedback-item {
    background: var(--bg-light);
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.3rem;
    border-radius: 4px;
    border-left: 2px solid var(--accent-color);
}

.feedback-item.thumbs-up {
    border-left-color: #28a745;
}

.feedback-item.thumbs-down {
    border-left-color: #dc3545;
}

.feedback-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.feedback-vote {
    font-size: 0.75rem;
    font-weight: 600;
}

.feedback-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Comment Vote Buttons */
.comment-vote-buttons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.comment-vote-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.comment-vote-btn:hover {
    background: var(--bg-light);
}

.comment-vote-btn.helpful:hover {
    border-color: #28a745;
    color: #28a745;
}

.comment-vote-btn.unhelpful:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.comment-vote-count {
    font-weight: 600;
}

.feedback-comment {
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.4;
    margin-top: 0.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* ============================================
   Feedback Widget
   ============================================ */

.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
}

.feedback-widget.minimized {
    height: auto;
}

.feedback-widget.minimized .feedback-widget-body {
    display: none;
}

.feedback-widget-header {
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-md);
    border-radius: 12px 12px 0 0;
}

.feedback-widget-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.feedback-widget-body {
    padding: var(--spacing-md);
}

.feedback-vote-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.vote-btn {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.vote-btn:hover {
    transform: scale(1.1);
}

.vote-btn.thumbs-up:hover,
.vote-btn.thumbs-up.selected {
    background: #28a745;
    border-color: #28a745;
}

.vote-btn.thumbs-down:hover,
.vote-btn.thumbs-down.selected {
    background: #dc3545;
    border-color: #dc3545;
}

.vote-btn.selected {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

.feedback-comment {
    width: 100%;
    min-height: 80px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: var(--spacing-sm);
}

.submit-feedback-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-feedback-btn:hover {
    background: var(--highlight-color);
}

.submit-feedback-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.feedback-status {
    margin-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.feedback-minimize-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    padding: 5px 10px;
}

.feedback-minimize-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

/* Mobile: Move navbar to bottom */
@media (max-width: 768px) {
    /* Bottom navbar */
    .navbar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0;
        z-index: 10001;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }

    .navbar-container {
        flex-direction: column;
        max-width: 100% !important;
        padding: 0;
    }

    .nav-brand {
        width: 100%;
        padding: 0.75rem 1rem;
        background: var(--secondary-color);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-brand h1 {
        font-size: 1.1rem;
    }

    .nav-brand::after {
        content: '▲';
        font-size: 1rem;
        transition: transform 0.3s ease;
    }

    .nav-brand.collapsed::after {
        transform: rotate(180deg);
    }

    .nav-menu {
        width: 100%;
        flex-direction: column;
        gap: 0;
        display: none;
    }

    .nav-menu.expanded {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu a {
        display: block;
        padding: 1rem;
        text-align: center;
        border-radius: 0;
    }

    /* Add bottom padding to body to account for fixed navbar */
    body {
        padding-bottom: 60px;
    }

    /* Tab overlay - make fullscreen on mobile */
    .tab-content-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 1rem;
        padding-top: 3.5rem; /* Space for close button */
        overflow: hidden !important; /* Never scroll the outer container */
    }

    .tab-close-btn {
        top: 10px;
        right: 15px;
        font-size: 2.5rem;
    }

    /* Ensure terms content scrolls properly on mobile */
    .terms-content {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: calc(100vh - 150px); /* Account for header and padding */
    }

    /* Smaller vote buttons on mobile */
    .comment-vote-buttons {
        gap: 0.2rem;
    }

    .comment-vote-btn {
        padding: 0.15rem 0.25rem;
        font-size: 0.6rem;
        border-radius: 2px;
    }

    .comment-vote-count {
        font-size: 0.6rem;
    }

    .feedback-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .feedback-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-size: 0.65rem;
    }

    .feedback-header {
        gap: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .feedback-sort {
        gap: 0.25rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .feedback-sort label {
        font-size: 0.9rem;
    }

    .feedback-sort-select {
        font-size: 0.9rem;
        padding: 0.4rem 0.5rem;
    }

    .feedback-summary {
        gap: 0.3rem;
        padding: 0.3rem;
        flex-direction: row !important;
    }

    .feedback-stat {
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
    }

    .feedback-stat-icon {
        font-size: 1.1rem;
    }

    .feedback-stat-text {
        font-size: 0.8rem;
    }

    .feedback-stat-count {
        font-size: 1.1rem;
    }

    /* Make feedback widget smaller on mobile */
    .feedback-widget {
        bottom: 80px; /* Account for bottom navbar + extra padding */
        right: 10px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: none;
        z-index: 10000; /* Above navbar but below cookie and tabs */
    }

    .feedback-widget.minimized {
        width: auto;
        left: auto;
        right: 10px;
        width: auto;
        max-width: 200px;
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .tab-content-container {
        padding: 0.5rem;
    }

    .tab-close-btn {
        font-size: 2rem;
        top: 5px;
        right: 10px;
    }

    .comment-vote-btn {
        padding: 0.1rem 0.2rem;
        font-size: 0.5rem;
    }

    .feedback-comment {
        font-size: 0.7rem;
    }

    .feedback-header {
        gap: 0.4rem !important;
        margin-bottom: 0.4rem !important;
    }

    .feedback-summary {
        padding: 0.25rem;
        gap: 0.25rem;
        flex-direction: row !important;
    }

    .feedback-stat {
        padding: 0.3rem 0.5rem;
        flex-direction: row !important;
    }

    .feedback-stat-icon {
        font-size: 1rem;
    }

    .feedback-stat-text {
        font-size: 0.75rem;
    }

    .feedback-stat-count {
        font-size: 1rem;
    }

    .feedback-sort {
        gap: 0.25rem;
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .feedback-sort label {
        font-size: 0.85rem;
    }

    .feedback-sort-select {
        font-size: 0.85rem;
        padding: 0.35rem 0.45rem;
    }

    .tab-panel h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .navbar,
    .footer,
    .feedback-widget,
    .tab-overlay {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    .evidence-item,
    .defendant-card,
    .violation-card {
        page-break-inside: avoid;
    }
}
