/* Base styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fbfd;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
}

/* Card styles */
.card {
    margin-bottom: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-header {
    background-color: #f8f9fa;
    font-weight: bold;
    border-radius: 8px 8px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.hero-link {
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
    transition: all 0.3s ease;
    display: inline-block;
}

.hero-link:hover {
    border-bottom-color: white;
    color: white !important;
    transform: translateX(5px);
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

.breadcrumb-item a {
    text-decoration: none;
    color: #0d6efd;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Well info card */
    .well-info-card {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-left: 4px solid #0d6efd;
        border-radius: 8px;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .property-info {
        display: flex;
        flex-direction: column;  /* stack vertically */
        align-items: flex-start; /* left-align */
        gap: 1rem;
        margin-bottom: 0.75rem;
    }
    .property-logo {
        max-height: 200px;
        max-width: 300px;
        object-fit: contain;
    }
    .property-owner {
        font-weight: 600;
        color: #495057;
        font-size: 0.95rem;
    }
    .info-item {
        margin-bottom: 0.5rem;
    }
    .info-label {
        font-weight: 600;
        color: #6c757d;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .info-value {
        color: #212529;
        margin-top: 0.15rem;
    }
    .aquifer-badge {
        display: inline-block;
        background-color: #0d6efd;
        color: white;
        padding: 0.35rem 0.75rem;
        border-radius: 20px;
        font-size: 0.85rem;
        font-weight: 500;
    }
    .kgs-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        color: #0d6efd;
        text-decoration: none;
        font-size: 0.9rem;
        padding: 0.35rem 0.75rem;
        border: 1px solid #0d6efd;
        border-radius: 5px;
        transition: all 0.2s ease;
    }
    .kgs-link:hover {
        background-color: #0d6efd;
        color: white;
    }
    .no-data-message {
        text-align: center;
        padding: 3rem 1rem;
        background-color: #fff3cd;
        border: 1px solid #ffc107;
        border-radius: 8px;
        margin: 2rem 0;
    }
    .no-data-message i {
        font-size: 3rem;
        color: #ffc107;
        margin-bottom: 1rem;
    }
    .no-data-message h4 {
        color: #856404;
        margin-bottom: 0.5rem;
    }
    .no-data-message p {
        color: #856404;
        margin-bottom: 0;
    }

/* Chart container */
.chart-container {
    min-height: 400px !important;
    height: 400px;
    margin-top: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

/* Chart loading overlay */
.chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    border-radius: 8px;
}

.chart-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

.chart-loading-overlay p {
    margin-top: 1rem;
    color: #666;
    font-weight: 500;
}

/* Section loading state */
.section-loading {
    opacity: 0.6;
    pointer-events: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Latest reading display */
.latest-reading {
    background-color: #e9f7fe;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.latest-reading:hover {
    background-color: #d4f0fd;
    transform: scale(1.02);
}

.latest-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.water-level .latest-value {
    color: #0d6efd;
}

.temperature .latest-value {
    color: #fd7e14;
}

.high-level .latest-value {
    color: #dc3545 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.latest-label {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 5px;
}

.latest-time {
    font-size: 0.9rem;
    color: #888;
}

/* Data summary section */
.data-summary {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 20px;
}

.summary-item {
    flex: 1;
    min-width: 120px;
    padding: 15px 10px;
    text-align: center;
    border-right: 1px solid #eee;
}

.summary-item:last-child {
    border-right: none;
}

.summary-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: bold;
}

/* Section headers */
.section-title {
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    color: #333;
}

/* Controls section */
.time-control {
    font-size: 0.9rem;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.animation-toggle {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #0d6efd;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Animation for plots */
.animated-plot .chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 1.5s ease-in-out forwards;
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

/* Page loader */
/* Page loader */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.loading-content {
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 350px;
}

.loading-content h4 {
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-content .progress {
    background-color: #e9ecef;
}

.loading-content .text-muted {
    font-size: 0.875rem;
    color: #6c757d !important;
}

/* Fade out animation for page loader */
.page-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.view-buttons {
    margin-left: auto;
}

.monthly-view-btn {
    font-size: 0.9rem;
}

/* Footer */
footer {
    margin-top: 50px;
    padding: 20px 0;
    background-color: #f8f9fa;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #eee;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .latest-value {
        font-size: 2rem;
    }
    
    .summary-item {
        min-width: 100px;
        padding: 10px 5px;
    }
    
    .summary-value {
        font-size: 1.2rem;
    }
    
    .header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-buttons {
        margin-left: 0;
        margin-top: 10px;
    }
}

.map-container {
    margin: 20px 0;
    height: 450px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.map-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}
