.court-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px 64px !important;
    font-family: 'Onest', sans-serif;
    box-sizing: border-box;
    width: 100%;
}

.court-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.court-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
}

.court-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 6px;
    margin-bottom: 0;
}

.court-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    background: #0D0D0F;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0 24px;
    border-radius: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

.light-theme .court-btn-primary {
    background: #eae2d2;
}

.court-btn-primary:hover {
    border-color: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.light-theme .court-btn-primary:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.court-btn-primary:active {
    opacity: 0.7;
}

/* Controls & Filters Header with Bottom Divider */
.court-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-highlight);
}

.court-header-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 16px;
    margin: 0;
}

.court-filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.court-search-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Custom Select Dropdowns */
.custom-select-container {
    position: relative;
    z-index: 10;
    width: 210px;
}

.custom-select-container.open {
    z-index: 110 !important;
}

.custom-select-trigger {
    width: 100%;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: 'Onest', sans-serif;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s ease;
    height: 44px;
    white-space: nowrap;
    gap: 8px;
}

.light-theme .custom-select-trigger {
    background: #eae2d2 !important;
}

.custom-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.light-theme .custom-select-trigger:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.chevron-icon {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.custom-select-container.open .chevron-icon {
    transform: rotate(180deg);
}

.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    min-width: 100%;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    z-index: 100;
    box-sizing: border-box;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    gap: 4px;
}

.light-theme .custom-select-options {
    background: #eae2d2 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.custom-select-container.open .custom-select-options {
    display: flex;
}

.custom-select-option {
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.light-theme .custom-select-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.custom-select-option.selected {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
}

.court-input {
    width: 100%;
    height: 44px;
    background: #0D0D0F;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 16px;
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
}

.light-theme .court-input {
    background: #eae2d2;
}

.court-input:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.court-file-input {
    display: flex;
    align-items: center;
    padding: 0 12px !important;
    line-height: normal;
}

.court-textarea {
    width: 100%;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
}

.light-theme .court-textarea {
    background: #eae2d2 !important;
}

.court-textarea:focus {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.court-input::placeholder,
.court-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.light-theme .court-input:focus {
    border-color: rgba(0, 0, 0, 0.25);
}

/* Cases Grid */
.court-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 24px;
}

.court-card {
    background: #0D0D0F;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
}

.light-theme .court-card {
    background: #eae2d2;
}

.court-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.25);
    opacity: 1;
}

.light-theme .court-card:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.court-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.court-case-num {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.court-case-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px;
    line-height: 1.3;
}

.court-case-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.court-case-parties {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.party-badge {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.party-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.party-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.court-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-highlight);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Unbounded', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.status-badge.open {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.status-badge.in_progress {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.verdict_issued {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.closed {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.3);
}

/* Detail Page Layout */
.court-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: flex-start;
    margin-top: 32px;
}

@media (max-width: 900px) {
    .court-detail-wrapper {
        grid-template-columns: 1fr;
    }
}

.court-main-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.court-section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 28px;
    box-sizing: border-box;
}

.court-section-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

/* Embedded Media */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
    background: #000;
    margin-top: 16px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.evidence-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.evidence-thumb {
    width: 100%;
    height: 110px;
    border-radius: 8px;
    border: 1px solid var(--border-highlight);
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.evidence-thumb:hover {
    opacity: 0.85;
}

/* Chat & Discussion */
.court-chat-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 20px;
}

.court-chat-msg {
    background: #0A0A0A;
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.court-chat-msg.official {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.03);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.msg-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.msg-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);

    white-space: pre-line;
}

.court-textarea {
    width: 100%;
    min-height: 90px;
    background: #0A0A0A;
    border: 1px solid var(--border-highlight);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    resize: vertical;
}

.court-textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Verdict Block */
.verdict-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
}

.verdict-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #10b981;
    font-family: 'Unbounded', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.verdict-content {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-line;
}

/* Player Autocomplete Dropdown */
.player-suggest-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    margin-top: 4px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 99999 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.player-suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Custom Dark Calendar Picker */
input[type="date"] {
    color-scheme: dark;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) hue-rotate(180deg) brightness(1.5);
    cursor: pointer;
    opacity: 0.8;
}

.custom-calendar-popover {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 290px;
    background: #0D0D0F !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    padding: 16px;
    z-index: 99999 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
    color: var(--text-main);
    font-family: 'Onest', sans-serif;
    box-sizing: border-box;
}

.custom-calendar-popover.is-active {
    display: block !important;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.calendar-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.calendar-nav-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.1rem;
}

.calendar-nav-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.calendar-weekdays span.saturday-title {
    color: #3b82f6;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-cell {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-main);
}

.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-day-cell.other-month {
    color: rgba(255, 255, 255, 0.2);
}

.calendar-day-cell.saturday-cell {
    border: 1px dashed rgba(59, 130, 246, 0.4);
    color: #3b82f6;
}

.calendar-day-cell.selected {
    background: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.player-suggest-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.player-suggest-head {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    image-rendering: pixelated;
}

@media (max-width: 768px) {
    .court-container {
        padding: 16px 16px 40px !important;
    }
}