/* Dashboard Custom Styles */

/* Site-wide max-width wrapper */
.site-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure navbar takes full width within wrapper */
.site-wrapper .navbar {
    width: 100%;
}

/* Ensure main content grows to fill available space */
.site-wrapper main {
    flex: 1;
}

/* Responsive behavior */
@media (max-width: 1300px) {
    .site-wrapper {
        margin: 0;
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .site-wrapper {
        padding: 0;
    }
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Chart specific styles */
.chart-container {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Status cards */
.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding: 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    #main-chart {
        height: 60vh !important;
    }
}

/* Loading animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Alert styles */
.alert {
    border: none;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Form controls */
.form-range {
    height: 1.5rem;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Fullscreen chart adjustments */
.card:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
}

.card:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
}

.card:fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: none;
    margin: 0;
    border-radius: 0;
}

/* ===== SEASONAL PIE CHART STYLES ===== */

/* Main seasonal chart container */
.seasonal-chart-container {
    margin-top: 20px;
    /* Made invisible - keeping only as structural placeholder */
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Pie chart wrapper */
.seasonal-pie-wrapper {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.seasonal-chart-canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 450px;
}

/* Seasonal summary - Right side vertical */
.seasonal-summary {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    height: 500px;
    overflow-y: auto;
    padding: 15px;
}

.seasonal-summary-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.seasonal-summary-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.seasonal-summary-item {
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.seasonal-summary-item:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

.seasonal-summary-item.active {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

/* Seasonal summary icon */
.seasonal-summary-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.seasonal-summary-item:hover .seasonal-summary-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    border-color: currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Seasonal summary info */
.seasonal-summary-info {
    flex: 1;
}

.seasonal-summary-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.seasonal-summary-consumption {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 2px;
}

.seasonal-summary-consumption .consumption-value {
    font-weight: 600;
    color: #2c3e50;
}

.seasonal-summary-consumption .consumption-unit {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 2px;
}

.seasonal-summary-percentage {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Seasonal legend styles */
.seasonal-legend {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    height: 400px;
    overflow-y: auto;
    padding: 15px;
}

.seasonal-legend-title {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

/* Individual legend items */
.seasonal-legend-item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.seasonal-legend-item:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateX(3px);
}

.seasonal-legend-item.active {
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

/* Legend icon */
.seasonal-legend-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.seasonal-legend-item:hover .seasonal-legend-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    border-color: currentColor;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Legend info */
.seasonal-legend-info {
    flex: 1;
}

.seasonal-legend-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 4px;
    text-transform: capitalize;
}

.seasonal-legend-consumption {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 2px;
}

.seasonal-legend-consumption .consumption-value {
    font-weight: 600;
    color: #2c3e50;
}

.seasonal-legend-consumption .consumption-unit {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 2px;
}

.seasonal-legend-percentage {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Seasonal color scheme for legend items */
.seasonal-legend-item[data-season="spring"] .seasonal-legend-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.seasonal-legend-item[data-season="summer"] .seasonal-legend-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.seasonal-legend-item[data-season="autumn"] .seasonal-legend-icon {
    background: linear-gradient(135deg, #fd7e14, #dc3545);
}

.seasonal-legend-item[data-season="winter"] .seasonal-legend-icon {
    background: linear-gradient(135deg, #17a2b8, #6f42c1);
}

/* Responsive adjustments for seasonal chart */
@media (max-width: 991px) {
    .seasonal-chart-container .row {
        flex-direction: column-reverse;
    }
    
    .seasonal-pie-wrapper {
        height: 500px;
        margin-top: 20px;
    }
    
    .seasonal-summary {
        height: auto;
        max-height: 300px;
    }
    
    .seasonal-summary-item {
        padding: 8px;
    }
    
    .seasonal-summary-icon {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 576px) {
    .seasonal-chart-container {
        /* Keep invisible - no padding needed for placeholder */
        padding: 0;
        margin-top: 15px;
    }
    
    .seasonal-pie-wrapper {
        height: 500px;
    }
    
    .seasonal-summary {
        padding: 12px;
        margin-top: 15px;
    }
    
    .seasonal-summary-item {
        padding: 6px;
    }
    
    .seasonal-summary-icon {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }
    
    .seasonal-summary-name {
        font-size: 0.85rem;
    }

    .seasonal-summary-consumption {
        font-size: 0.8rem;
    }
}

/* Features Carousel Styles */
#features-carousel {
    position: relative;
}

#features-carousel .carousel-item {
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

#features-carousel .carousel-item.active {
    opacity: 1;
}

#features-carousel .carousel-indicators {
    bottom: -50px;
}

#features-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #007bff;
    background-color: transparent;
    transition: all 0.3s ease;
}

#features-carousel .carousel-indicators button.active {
    background-color: #007bff;
    transform: scale(1.2);
}

#features-carousel .carousel-control-prev,
#features-carousel .carousel-control-next {
    width: 5%;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#features-carousel .carousel-control-prev:hover,
#features-carousel .carousel-control-next:hover {
    opacity: 1;
}

#features-carousel .carousel-control-prev-icon,
#features-carousel .carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

#features-carousel .feature-icon {
    transition: transform 0.3s ease;
}

#features-carousel .carousel-item.active .feature-icon {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#features-carousel .card-title {
    transition: color 0.3s ease;
}

#features-carousel .carousel-item.active .card-title {
    color: #007bff;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#features-carousel .card-text {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}


/* Mobile responsiveness */
@media (max-width: 768px) {
    #features-carousel .carousel-control-prev,
    #features-carousel .carousel-control-next {
        display: none;
    }

    #features-carousel .carousel-indicators {
        bottom: -40px;
    }
}

@media (max-width: 576px) {
    #features-carousel .card-body {
        padding: 2rem 1rem !important;
    }

    #features-carousel .feature-icon i {
        font-size: 3rem !important;
    }

    #features-carousel .card-title {
        font-size: 1.5rem !important;
    }
}