/* Cases Page Styles */

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Page Background Overlay */
body {
    margin: 0;
    padding: 0;
    font-family: 'Bricolage Grotesque', sans-serif;
    background: #101010;
    color: #ffffff;
    overflow: hidden;
}

.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a, #1a0a0a);
    z-index: 1;
    pointer-events: none;
}

.page-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('logo.svg') no-repeat center center;
    background-size: 150%;
    opacity: 0.03;
    filter: brightness(0);
}

.page-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to left, rgba(255, 63, 63, 0.2), transparent);
}

@media screen and (max-width: 768px) {
    .page-overlay {
        background: linear-gradient(145deg, #1a1a1a, #252525);
    }
    
    .page-overlay::after {
        display: none;
    }
}

/* Main Container - Full Height */
.cases-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 100;
    overflow: hidden;
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    .cases-container {
        padding-top: max(0px, env(safe-area-inset-top));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Sidebar Panel */
.sidebar-panel {
    width: 480px;
    background: linear-gradient(145deg, #1a1a1a, #252525);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: overlay;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-gutter: stable;
}

/* Logo in Sidebar */
.sidebar-logo {
    padding: 20px 25px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo .logo {
    max-width: 80px;
    height: auto;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.sidebar-logo .logo:hover {
    opacity: 0.8;
}

/* Filter Section */
.filter-section {
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.filter-header {
    padding: 30px 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-header h2 {
    font-family: 'Segment A Key Trial', sans-serif;
    font-weight: 900;
    font-size: 42px;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1;
}

.results-count {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #FF3F3F;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-content {
    padding: 25px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-label {
    display: block;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    user-select: none;
}

.select-trigger {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.select-trigger span {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #ffffff;
}

.select-trigger svg {
    color: #999;
    transition: transform 0.3s ease;
}

.custom-select.open .select-trigger svg {
    transform: rotate(180deg);
}

.custom-select.open .select-trigger {
    border-color: #FF3F3F;
}

.select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.custom-select.open .select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: 12px 16px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #cccccc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-option:hover {
    background: rgba(255, 63, 63, 0.1);
    color: #ffffff;
}

.select-option.active {
    background: rgba(255, 63, 63, 0.2);
    color: #FF3F3F;
    font-weight: 600;
}

/* Year Slider */
.year-slider-container {
    padding-top: 5px;
}

.year-display {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.year-display span {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    background: rgba(255, 63, 63, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
}

.slider-track {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 10px 0;
}

.slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #FF3F3F, #cc3232);
    border-radius: 3px;
    pointer-events: none;
}

.slider-input {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 0;
    left: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF3F3F;
    border: 3px solid #ffffff;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(255, 63, 63, 0.5);
    transition: all 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 63, 63, 0.7);
}

.slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FF3F3F;
    border: 3px solid #ffffff;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 8px rgba(255, 63, 63, 0.5);
    transition: all 0.2s ease;
}

.slider-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(255, 63, 63, 0.7);
}

/* Clear Filters Button */
.clear-filters {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.clear-filters:hover {
    border-color: #FF3F3F;
    color: #FF3F3F;
    background: rgba(255, 63, 63, 0.1);
}

/* Cases List Section */
.cases-list {
    flex: 1;
    padding: 20px;
}

/* Case Preview Card */
.case-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.case-card:hover {
    border-color: rgba(255, 63, 63, 0.5);
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 63, 63, 0.2);
}

.case-card.expanded {
    border-color: #FF3F3F;
}

.case-card-header {
    display: flex;
    gap: 15px;
    padding: 15px;
    align-items: center;
}

.case-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.case-preview-info {
    flex: 1;
    min-width: 0;
}

.case-preview-name {
    font-family: 'Segment A Key Trial', sans-serif;
    font-weight: 400;
    font-size: 28px;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.2;
}

.case-preview-location {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #999;
    margin: 0 0 8px 0;
}

.case-preview-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.case-meta-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 63, 63, 0.15);
    color: #FF3F3F;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 11px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-expand-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: transform 0.3s ease;
}

.case-card.expanded .case-expand-icon {
    transform: rotate(180deg);
}

/* Case Expanded Details */
.case-expanded-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.case-card.expanded .case-expanded-details {
    max-height: 600px;
}

.case-expanded-content {
    padding: 0 15px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.case-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 15px 0;
}

.case-detail-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: 6px;
}

.case-detail-label {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.case-detail-value {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.case-description-section {
    margin-top: 15px;
}

.case-description-section h4 {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-description-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}

.case-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.case-action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.case-action-btn.primary {
    background: linear-gradient(135deg, #FF3F3F, #cc3232);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 63, 63, 0.3);
}

.case-action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 63, 63, 0.5);
}

.case-action-btn.secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.case-action-btn.secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Map Panel */
.map-panel {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
}

/* Custom Leaflet Controls Styling */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
    background-color: #FF3F3F !important;
    border-color: #FF3F3F !important;
}

/* Custom Marker Styling */
.custom-marker {
    width: 16px;
    height: 16px;
    background-color: #FF3F3F;
    border: 3px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 63, 63, 0.5);
}

.custom-marker:hover {
    transform: scale(1.3);
    box-shadow: 0 6px 20px rgba(255, 63, 63, 0.8);
}

.custom-marker.active {
    background-color: #ffffff;
    border-color: #FF3F3F;
    transform: scale(1.5);
    box-shadow: 0 6px 20px rgba(255, 63, 63, 0.9);
}

/* Floating Buttons Container (Mobile Only) */
.floating-buttons-container {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    gap: 15px;
}

/* Floating Buttons (Mobile Only) */
.floating-map-btn,
.floating-close-btn {
    display: none;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF3F3F, #cc3232);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(255, 63, 63, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.floating-map-btn:hover,
.floating-close-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(255, 63, 63, 0.6);
}

.floating-map-btn:active,
.floating-close-btn:active {
    transform: translateY(-1px);
}

.floating-close-btn {
    width: 60px;
    height: 60px;
}

.floating-close-btn svg {
    width: 28px;
    height: 28px;
}

/* Custom Scrollbar */
.sidebar-panel::-webkit-scrollbar {
    width: 8px;
}

.sidebar-panel::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.sidebar-panel::-webkit-scrollbar-thumb {
    background: #FF3F3F;
    border-radius: 4px;
}

.sidebar-panel::-webkit-scrollbar-thumb:hover {
    background: #cc3232;
}

/* Responsive Design */
@media screen and (max-width: 1280px) {
    .sidebar-panel {
        width: 420px;
    }
}

@media screen and (max-width: 1024px) {
    .sidebar-panel {
        width: 380px;
    }
    
    .sidebar-logo .logo {
        max-width: 70px;
    }
    
    .case-image {
        width: 70px;
        height: 70px;
    }
    
    .case-preview-name {
        font-size: 24px;
    }
    
    .filter-header h2 {
        font-size: 36px;
    }
}

@media screen and (max-width: 768px) {
    .cases-container {
        flex-direction: column;
        top: 60px;
    }
    
    .sidebar-panel {
        width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        min-height: 100vh;
    }
    
    .map-panel {
        display: none;
        width: 100%;
        height: 100%;
    }
    
    .map-panel.active {
        display: block;
    }
    
    .sidebar-panel.hidden {
        display: none;
    }
    
    .sidebar-logo {
        padding: 18px 20px 16px;
    }
    
    .sidebar-logo .logo {
        max-width: 65px;
    }
    
    .filter-header h2 {
        font-size: 32px;
    }
    
    .case-preview-name {
        font-size: 22px;
    }
    
    .floating-buttons-container {
        display: flex;
        bottom: 25px;
    }
    
    .floating-map-btn {
        display: flex;
    }
    
    .floating-close-btn.active {
        display: flex;
    }
}

@media screen and (max-width: 480px) {
    .sidebar-logo {
        padding: 16px 20px 14px;
    }
    
    .sidebar-logo .logo {
        max-width: 60px;
    }
    
    .filter-header h2 {
        font-size: 28px;
    }
    
    .case-preview-name {
        font-size: 20px;
    }
    
    .case-image {
        width: 60px;
        height: 60px;
    }
    
    .floating-buttons-container {
        bottom: 20px;
    }
    
    .floating-map-btn,
    .floating-close-btn {
        width: 60px;
        height: 60px;
        font-size: 10px;
    }
    
    .floating-map-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .floating-close-btn {
        width: 54px;
        height: 54px;
    }
    
    .floating-close-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FF3F3F, #cc3232);
    color: #ffffff;
    padding: 16px 32px;
    border-radius: 50px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 8px 30px rgba(255, 63, 63, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: bottom 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    bottom: 40px;
}

.toast span {
    font-size: 20px;
    font-weight: bold;
}

/* Landscape orientation handling */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .sidebar-logo {
        padding: 15px 25px 14px;
    }
    
    .sidebar-logo .logo {
        max-width: 60px;
    }
    
    .filter-header {
        padding: 20px 25px 15px;
    }
    
    .filter-header h2 {
        font-size: 28px;
    }
}
