/* Minimal Color Palette */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --text-dark: #1a202c;
    --text: #2d3748;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --background: #f7fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-light: #edf2f7;
    --accent: #48bb78;
    --accent-light: #c6f6d5;
    --star-filled: #ecc94b;
    --star-empty: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Dashboard Container */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Header Styles - Centered */
.header {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 32px 24px;
    margin-bottom: 24px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.govt-text {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--border-light);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-header .material-icons {
    font-size: 20px;
    color: var(--primary);
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Section Subtitle */
.section-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Detail Rows */
.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.detail-value.mono {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    color: var(--text-dark);
}

.detail-value.muted {
    color: var(--text-muted);
}

.challan-amount {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-dark);
}

/* Violation Card - Split Layout */
.violation-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
}

.violation-section {
    padding: 0;
}

.violation-divider {
    width: 1px;
    background: var(--border);
}

@media (max-width: 768px) {
    .violation-split {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .violation-divider {
        width: 100%;
        height: 1px;
    }
}

/* Severity Scale - Inline 4-level */
.severity-scale-inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.severity-level {
    display: flex;
    align-items: center;
    gap: 6px;
}

.severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--border);
    transition: all 0.2s ease;
}

/* Active severity dots get filled with color */
.severity-level.active[data-level="1"] .severity-dot { background: #48bb78; border-color: #48bb78; box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.25); }
.severity-level.active[data-level="2"] .severity-dot { background: #ed8936; border-color: #ed8936; box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.25); }
.severity-level.active[data-level="3"] .severity-dot { background: #e53e3e; border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.25); }
.severity-level.active[data-level="4"] .severity-dot { background: #c53030; border-color: #c53030; box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.25); }

.severity-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
}

.severity-level.active .severity-name {
    color: var(--text-dark);
    font-weight: 600;
}

@media (max-width: 576px) {
    .severity-scale-inline {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .severity-name {
        font-size: 11px;
    }
}

/* Info Card - 3 Column Layout */
.info-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.info-column {
    padding-right: 24px;
    border-right: 1px solid var(--border-light);
}

.info-column:last-child {
    border-right: none;
    padding-right: 0;
}

@media (max-width: 992px) {
    .info-columns {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    
    .info-column {
        border-right: none;
        padding-right: 0;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-light);
    }
    
    .info-column:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

@media (max-width: 576px) {
    .info-columns {
        grid-template-columns: 1fr;
    }
}

/* Status Badge */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.status-badge.valid {
    background: var(--accent-light);
    color: #276749;
}

/* Document Items */
.doc-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
}

.check-icon {
    font-size: 16px;
    color: var(--accent);
}

.documents-status {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: #276749;
}

/* Overall Rating Badge */
.overall-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.rating-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.rating-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (max-width: 576px) {
    .overall-rating {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .summary-card .card-header {
        flex-wrap: wrap;
    }
}

/* Case Summary Card */
.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.summary-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
}

/* Metrics Card */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-item {
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.metric-header {
    margin-bottom: 8px;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.star-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star-rating .star {
    font-size: 18px;
    color: var(--star-empty);
}

.star-rating .star.filled {
    color: var(--star-filled);
}

.star-rating.na .star {
    color: var(--star-empty);
}

.metric-score {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.metric-description {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Feedback Box */
.feedback-box {
    padding: 14px 16px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: #276749;
    line-height: 1.6;
}

.feedback-box strong {
    color: #22543d;
}

/* Entry Count Badge */
.entry-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--background);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Transcript Card */
.transcript-card .card-header {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding-bottom: 12px;
    transition: background 0.2s;
    border-radius: var(--radius-sm);
}

.transcript-card .card-header:hover {
    background: var(--background);
}

.transcript-card .card-header.clickable {
    justify-content: space-between;
}

.expand-icon {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.transcript-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.transcript-content.expanded {
    max-height: 2000px;
    padding: 20px 0 0 0;
    border-top: 1px solid var(--border-light);
    margin-top: 12px;
}

.transcript-entry {
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
}

.transcript-entry.officer {
    background: rgba(26, 54, 93, 0.05);
    border-left: 3px solid var(--primary);
    margin-right: 40px;
}

.transcript-entry.rider {
    background: var(--background);
    border-left: 3px solid var(--border);
    margin-left: 40px;
}

@media (max-width: 576px) {
    .transcript-entry.officer,
    .transcript-entry.rider {
        margin-left: 0;
        margin-right: 0;
    }
}

.speaker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.officer-badge {
    color: var(--primary);
}

.rider-badge {
    color: var(--text-muted);
}

.speaker-badge .material-icons {
    font-size: 14px;
}

.transcript-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

/* Video Container */
.video-container {
    margin-bottom: 20px;
}

.incident-video {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #000;
}

/* Photo Gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
}

.photo-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 16/10;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.photo-item:hover img {
    transform: scale(1.03);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #ccc;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 20px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }

    .header {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 22px;
    }

    .card {
        padding: 16px;
    }

    .case-meta {
        gap: 16px;
    }
}

/* Print Styles */
@media print {
    .header {
        background: var(--primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .card {
        box-shadow: none;
        border: 1px solid var(--border);
    }

    .modal, .footer {
        display: none;
    }

    .transcript-content {
        max-height: none !important;
        padding-top: 20px !important;
    }
}
