:root {
    --track-1: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    --track-2: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%);
    --track-3: linear-gradient(90deg, #f3e5f5 0%, #e1bee7 100%);
    --track-4: linear-gradient(90deg, #e8f5e8 0%, #c8e6c9 100%);
    --track-5: linear-gradient(90deg, #fff3e0 0%, #ffe0b2 100%);
    --hydrocarbon: rgba(255, 235, 59, 0.3);
    --water-zone: rgba(33, 150, 243, 0.2);
    --shale-zone: rgba(158, 158, 158, 0.2);
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body {
    background: var(--primary-gradient);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Center all glass panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    width: 100%;
}

/* Main visualization containers - centered */
#compositeLog,
#crossplotSection,
#threeDSection,
#zoneSection,
#additionalViz {
    margin: 0 auto;
    width: 100%;
}

/* Plot containers - centered with max-width */
#logPlot,
#crossplot2d,
#plot3d,
#histogramPlot,
#spiderPlot,
#heatmapPlot,
#zoneVisualization {
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
}

/* Specific sizing for different plot types */
#logPlot {
    height: 700px;
}

#crossplot2d {
    height: 500px;
}

#plot3d {
    height: 500px;
}

#histogramPlot,
#spiderPlot {
    height: 350px;
    width: 100%;
    max-width: 550px;
}

#heatmapPlot {
    height: 450px;
    width: 100%;
    max-width: 650px;
}

#zoneVisualization {
    height: 100%;
}

/* Center content in columns */
.col-lg-3, .col-lg-9 {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center sidebar content */
.sidebar-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Center navigation */
.navbar {
    width: 100%;
    margin: 0 auto;
    border-radius: 15px;
    max-width: 98%;
}

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

/* Center well name display */
#wellNameDisplay {
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.3);
    display: inline-block;
    margin: 0 auto;
}

/* Center curve selection */
#curveSelection {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
}

/* Center buttons in control panel */
.d-grid {
    display: grid;
    gap: 10px;
}

/* Center color palette buttons */
.d-flex.flex-wrap {
    justify-content: center;
}

/* Center statistics panel */
#statsPanel {
    text-align: center;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 15px;
    margin: 10px auto;
    max-width: 300px;
}

/* Center data table */
.data-table {
    max-height: 400px;
    overflow-y: auto;
    margin: 0 auto;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

/* Center modal content */
.modal-3d-content {
    width: 95%;
    height: 95%;
    margin: 2.5% auto;
    background: #1a1a1a;
    border-radius: 15px;
    padding: 20px;
    position: relative;
}

#fullscreen3d {
    width: 100%;
    height: calc(100% - 40px);
    margin-top: 10px;
}

/* Center footer */
footer {
    text-align: center;
    width: 100%;
    margin-top: auto;
    padding: 20px 0;
}

/* Crossplot dropdowns - center alignment */
.three-d-controls .col-md-3 {
    margin-bottom: 10px;
}

.three-d-controls select {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

/* Zone details panel */
#zoneDetails {
    text-align: left;
    margin: 0 auto;
}

.formation-detail-card {
    max-width: 300px;
    margin: 0 auto;
}

/* Progress bar for hydrocarbon potential */
.progress {
    margin: 10px auto;
    max-width: 300px;
}

/* =====================================================================
   RESPONSIVE BREAKPOINTS
   ===================================================================== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
    }
    
    #logPlot {
        height: 800px;
    }
    
    #crossplot2d,
    #plot3d {
        height: 600px;
    }
}

/* Desktop (992px to 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    #logPlot {
        height: 650px;
    }
    
    #crossplot2d,
    #plot3d {
        height: 450px;
    }
    
    #zoneVisualization {
        height: 450px;
    }
}

/* Tablet (768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .log-track {
        height: 500px;
    }
    
    #logPlot {
        height: 500px;
    }
    
    #crossplot2d,
    #plot3d {
        height: 400px;
    }
    
    #zoneVisualization {
        height: 400px !important;
    }
    
    #histogramPlot,
    #spiderPlot {
        height: 300px;
        max-width: 100%;
    }
    
    #heatmapPlot {
        height: 400px;
        max-width: 100%;
    }
    
    /* Stack columns on tablet */
    .col-lg-3, .col-lg-9 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    /* Center all content */
    .glass-panel {
        margin: 10px auto;
    }
}

/* Mobile (767px and down) */
@media (max-width: 767px) {
    .log-track {
        height: 400px;
    }
    
    #logPlot {
        height: 400px;
    }
    
    #crossplot2d,
    #plot3d {
        height: 350px;
    }
    
    #zoneVisualization {
        height: 350px !important;
    }
    
    #histogramPlot,
    #spiderPlot {
        height: 300px;
        max-width: 100%;
    }
    
    #heatmapPlot {
        height: 350px;
        max-width: 100%;
    }
    
    /* Full width on mobile */
    .col-lg-3, .col-lg-9 {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        padding: 0 5px;
    }
    
    /* Adjust font sizes */
    h4 {
        font-size: 1.2rem;
    }
    
    h6 {
        font-size: 1rem;
    }
    
    /* Stack buttons */
    .d-flex.flex-wrap {
        justify-content: center;
    }
    
    .btn-sm {
        margin: 2px;
    }
    
    /* Adjust navbar */
    .navbar-brand {
        font-size: 1rem;
    }
    
    #wellNameDisplay {
        font-size: 0.8rem;
        padding: 3px 8px;
        margin: 5px 0;
        display: block;
    }
    
    /* Stack navbar items */
    .navbar-nav {
        flex-direction: row;
        justify-content: center;
        margin-top: 10px;
    }
    
    .navbar-nav .btn {
        margin: 2px;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Adjust 3D controls */
    .three-d-controls .col-md-3 {
        width: 50%;
        float: left;
    }
    
    /* Center modal */
    .modal-3d-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }
}

/* Small Mobile (480px and down) */
@media (max-width: 480px) {
    #logPlot {
        height: 350px;
    }
    
    #crossplot2d,
    #plot3d {
        height: 300px;
    }
    
    #zoneVisualization {
        height: 300px !important;
    }
    
    #histogramPlot,
    #spiderPlot {
        height: 250px;
    }
    
    #heatmapPlot {
        height: 300px;
    }
    
    /* Stack everything */
    .three-d-controls .col-md-3 {
        width: 100%;
    }
    
    /* Smaller fonts */
    body {
        font-size: 14px;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    .glass-panel {
        padding: 15px !important;
    }
    
    /* Adjust depth range inputs */
    #depthStart, #depthStop {
        font-size: 0.9rem;
    }
}

/* =====================================================================
   UTILITY CLASSES FOR CENTERING
   ===================================================================== */

.center-block {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.center-text {
    text-align: center;
}

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

.center-grid {
    display: grid;
    place-items: center;
}

/* =====================================================================
   CROSSHAIR STYLING
   ===================================================================== */

.crosshair {
    position: absolute;
    pointer-events: none;
    z-index: 1000;
}

.crosshair-vertical {
    width: 1px;
    background: rgba(255,0,0,0.7);
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
}

.crosshair-horizontal {
    height: 1px;
    background: rgba(255,0,0,0.7);
    left: 0;
    right: 0;
    transform: translateY(-50%);
}

/* =====================================================================
   FORMATION MAP / ZONE VISUALIZATION
   ===================================================================== */

#zoneVisualization svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
    margin: 0 auto;
}

#zoneVisualization text {
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* =====================================================================
   ALERTS AND NOTIFICATIONS
   ===================================================================== */

.alert-info.position-fixed {
    max-width: 90%;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

/* =====================================================================
   COLOR LEGEND
   ===================================================================== */

.color-legend {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
}

/* =====================================================================
   HOVER EFFECTS
   ===================================================================== */

.btn-sm[style*="background"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-sm[style*="background"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* =====================================================================
   ANIMATIONS
   ===================================================================== */

.animation-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.7; }
    100% { opacity: 0.3; }
}

/* =====================================================================
   PRINT STYLES
   ===================================================================== */

@media print {
    body {
        background: white;
    }
    
    .glass-panel {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn, .navbar, footer {
        display: none !important;
    }
}
#zoneVisualization {
    width: 100%;
}

.formation-zone:hover {
    opacity: 0.9;
}
/* =====================================================================
   LEGENDA ZONE STYLING
   ===================================================================== */

.color-legend {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 10px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.color-legend:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Group untuk legenda */
#zoneSection .col-md-3 {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

#zoneSection .col-md-3::-webkit-scrollbar {
    width: 5px;
}

#zoneSection .col-md-3::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#zoneSection .col-md-3::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#zoneSection .col-md-3::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Styling untuk teks legenda */
#zoneSection .col-md-3 span {
    font-size: 0.9rem;
    line-height: 1.4;
}

#zoneSection .col-md-3 small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Divider styling */
#zoneSection hr {
    margin: 12px 0;
    border-top: 1px solid #dee2e6;
    opacity: 0.5;
}

/* Alert info styling */
#zoneSection .alert-info {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #0d47a1;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Responsive untuk mobile */
@media (max-width: 768px) {
    .color-legend {
        width: 20px;
        height: 20px;
    }
    
    #zoneSection .col-md-3 span {
        font-size: 0.8rem;
    }
    
    #zoneSection .col-md-3 {
        max-height: 300px;
        margin-bottom: 20px;
    }
}
/* =====================================================================
   FORMATION MAP - UKURAN DIPERBESAR
   ===================================================================== */

#zoneVisualization {
    width: 100%;
    min-height: 500px;
    margin: 0 auto;
    position: relative;
}

#zoneVisualization div {
    scrollbar-width: thin;
    scrollbar-color: #2196F3 #e0e0e0;
}

#zoneVisualization div::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#zoneVisualization div::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#zoneVisualization div::-webkit-scrollbar-thumb {
    background: #2196F3;
    border-radius: 10px;
}

#zoneVisualization div::-webkit-scrollbar-thumb:hover {
    background: #1976D2;
}

.formation-zone {
    transition: filter 0.2s ease;
}

.formation-zone:hover {
    filter: brightness(1.05);
}

.zone-main {
    transition: all 0.2s ease;
}

/* Tooltip styling */
.formation-detail-card {
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: none;
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #zoneVisualization div {
        height: 500px !important;
    }
    
    #zoneVisualization svg {
        min-width: 1000px; /* Horizontal scroll untuk mobile */
    }
}