:root {
    --primary-blue: #074D9E;
    --light-blue: #2BA8E0;
    --accent-green: #8DC340;
    --accent-red: #CF1E4C;
    --accent-orange: #F68C20;
    --accent-purple: #832366;
    --light-gray: #DCDDDE;
}

/* Background Slideshow */
.background-slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: slideshow 40s linear infinite;
}

.slide:nth-child(1) {
    animation-delay: 0s;
}

.slide:nth-child(2) {
    animation-delay: 10s;
}

.slide:nth-child(3) {
    animation-delay: 20s;
}

.slide:nth-child(4) {
    animation-delay: 30s;
}

@keyframes slideshow {
    0% {
        opacity: 0;
    }
    4% {
        opacity: 1;
    }
    23% {
        opacity: 1;
    }
    27% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* Hero Section */
.hero-section {
    height: 60vh;
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1rem;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform, background-position;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
    z-index: 0;
    pointer-events: none;
    transform: translateZ(0);
}

.hero-content {
    text-align: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 95%;
    position: relative;
    z-index: 2;
    will-change: transform, opacity;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

#hero-title, #hero-text {
    will-change: transform;
    transform-style: preserve-3d;
    backface-visibility: hidden;
    transition: transform 0.5s ease-out;
}

/* Hero Text Styles */
.hero-section .display-4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 5rem;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4),
                 0 0 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: titleReveal 1.2s ease-out forwards;
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section .lead {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7),
                 0 0 20px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
}

/* Home Page Hero Section */
#hero-section {
    height: 95vh;
}

/* FAQ Accordion Styles */
.accordion-button {
    background-color: var(--primary-blue) !important;
    color: white !important;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background-color: var(--primary-blue) !important;
    color: white !important;
}

.accordion-button::after {
    filter: brightness(0) invert(1);
}

/* Remove focus outline and fix accordion formatting */
.accordion-button:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

.accordion-body {
    background-color: white !important;
    padding: 1rem !important;
    border: none !important;
}

.accordion-body ul {
    padding-left: 1.5rem;
}

.accordion-body p:last-child,
.accordion-body ul:last-child {
    margin-bottom: 0 !important;
}

.accordion-item {
    border: none !important;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: white !important;
}

.accordion-collapse {
    background-color: white !important;
    border: none !important;
}

/* Spinner Overlay */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner-overlay.active {
    display: flex;
}

.spinner-text {
    margin-top: 1rem;
    color: var(--primary-blue);
    font-weight: 500;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-blue);
}

/* Navbar Styles */
.navbar {
    background-color: var(--primary-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-brand, .nav-link {
    color: white !important;
}

.nav-link:hover {
    color: var(--light-gray) !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Content Styles */
body {
    background-color: #f8f9fa;
}

.content {
    position: relative;
    z-index: 1;
}

/* Home Page Section Styles */
.py-5 {
    position: relative;
    padding: 3rem 0 !important;
}

.display-5 {
    color: var(--primary-blue);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 2rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    color: #2c3e50;
    line-height: 1.8;
}

/* List Styles */
.list-unstyled li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 1.1rem;
    color: #2c3e50;
    text-indent: -1.5rem;
    padding-left: 1.5rem;
    margin-left: 1.5rem;
}

.list-unstyled li::before {
    position: absolute;
    left: 0;
}

/* Image Styles */
.rounded.overflow-hidden {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rounded.overflow-hidden:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.rounded.overflow-hidden img {
    transition: transform 0.3s ease;
}

.rounded.overflow-hidden:hover img {
    transform: scale(1.05);
}

/* Image Hover Container Styles */
.image-hover-container {
    border-radius: 0.375rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    padding: 15px;
    background-color: white;
    transition: box-shadow 0.3s ease;
}

.image-hover-container:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.hover-zoom {
    transition: transform 0.3s ease-in-out;
    width: 100%;
    display: block;
    border-radius: 0.25rem;
}

.image-hover-container:hover .hover-zoom {
    transform: scale(1.2);
    transform-origin: center center;
}

/* Page Styles */
.optimization-page .display-4,
.comparison-page .display-4 {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 0, 0, 0.3);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.2);
}

.optimization-page .card {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
}

.optimization-page .card:hover {
    background-color: white;
}

/* Plot Styles */
.plot-wrapper {
    background-color: white !important;
    padding: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plot-wrapper > div {
    background-color: white !important;
}

.card-header {
    background-color: #074D9E;
    color: white;
    border-bottom: none;
    font-weight: bold;
    padding: 1rem 1.25rem;
}

.list-group-item {
    background-color: transparent;
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
    font-weight: 600;
}

/* Example Data Download Links */
.example-data-link {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.875rem;
}

.example-data-link:hover {
    text-decoration: underline;
    color: var(--light-blue);
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(7, 77, 158, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:active, .btn-primary:focus {
    background-color: white !important;
    border-color: var(--primary-blue) !important;
    color: var(--primary-blue) !important;
    box-shadow: 0 0 0 0.2rem rgba(7, 77, 158, 0.25) !important;
}

.btn-secondary {
    background-color: var(--light-gray);
    border-color: var(--light-gray);
    color: var(--primary-blue);
}

.btn-secondary:hover {
    background-color: white;
    border-color: var(--light-gray);
    color: var(--primary-blue);
}

/* Export button styles */
.export-button {
    min-width: 180px;
}

/* Form Styles */
.form-control:focus {
    border-color: var(--light-blue);
    box-shadow: 0 0 0 0.2rem rgba(7, 77, 158, 0.25);
}

.input-group-text {
    background-color: var(--light-gray);
    color: var(--primary-blue);
    border-color: #ced4da;
}

/* Alert Styles */
.alert-primary {
    background-color: rgba(7, 77, 158, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.alert-success {
    background-color: rgba(141, 195, 64, 0.1);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.alert-danger {
    background-color: #fde8ec;
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Table Styles */
.table {
    color: #333;
}

.table thead th {
    background-color: var(--primary-blue);
    color: white;
    border-bottom: none;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(7, 77, 158, 0.05);
}

/* Footer Styles */
footer {
    background-color: #F8F9FA !important;
    border-top: 3px solid var(--primary-blue);
    position: relative;
    z-index: 1030;
    box-shadow: 0 -8px 15px -10px var(--primary-blue);
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.footer-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.footer-logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.footer-logo[alt="AWW Logo"] {
    height: 50px;
}

/* Contact Section Styles */
.contact-section {
    margin-bottom: 1.5rem;
}

.contact-section a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 0 0.5rem;
    font-weight: 500;
}

.contact-section a:hover {
    color: var(--light-blue);
    text-decoration: underline;
}

/* Revenue Value Styles */
.revenue-value {
    font-size: 1.4rem !important;
    font-weight: normal !important;
}

/* Media Queries */
@media (min-width: 768px) {
    .revenue-value {
        font-size: 1.6rem !important;
    }
}

/* Animation Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    will-change: opacity, transform;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up:not(.visible) {
    opacity: 0;
    transform: translateY(8px);
}

/* Print Styles */
@media print {
    /* Make all text black */
    * {
        color: black !important;
        text-shadow: none !important;
    }

    /* Ensure card headers are black text */
    .card-header {
        background-color: transparent !important;
        color: black !important;
    }

    /* Remove background colors and shadows */
    .card, .plot-wrapper {
        background-color: transparent !important;
        box-shadow: none !important;
    }

    /* Ensure plots fit on page */
    .plot-wrapper {
        page-break-inside: avoid;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .plot-wrapper > div {
        width: 100% !important;
        height: auto !important;
        max-height: 500px !important;
    }

    /* Hide unnecessary elements when printing */
    .navbar, .footer, .background-slideshow, .btn {
        display: none !important;
    }

    /* Ensure content fits on page */
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Add page breaks where needed */
    .card {
        page-break-inside: avoid;
        margin-bottom: 20px !important;
    }
}
