/* Main styles for the Badge Up application */
/* Note: Due to issues with how Struts 2 handles CSS classes, some styles might not be applied correctly.
   Inline styles have been added as a workaround for critical elements like buttons. */

/* Navigation Bar Styles */
.nav-bar {
    display: flex;
    /* Using flex-start to align items at the start */
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    padding: 5px 20px; /* align with .container’s 20px side padding for consistent width visuals */
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin: 0 auto 20px auto;
    max-width: 1600px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(76, 175, 80, 0.3);
    /* Ensure the container takes full width */
    width: 100%;
    box-sizing: border-box; /* ensure padding stays within width to match container */
}

.nav-logo {
    display: flex;
    padding: 0;
    height: 100%;
    align-items: flex-end;
}

.nav-logo-img {
    height: 75px; /* Changed from 50px to 75px as requested */
    max-height: 85%; /* Increased to accommodate larger height */
    width: auto;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
    padding-left: 10px;
}

.nav-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    /* Removed flex-grow: 1 to prevent excessive space expansion */
    margin-right: 5px;
    /* Push to the right side */
    margin-left: auto;
    /* Add max-width to prevent excessive expansion */
    max-width: fit-content;
    /* Push buttons down by 10px */
    margin-top: 10px;
}

.nav-btn {
    padding: 2px 16px 6px 16px; /* Added more padding at the bottom */
    background-color: #2e7d32;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.92em; /* Increased by 20% from 1.6em to 1.92em */
    line-height: 1;
}

.nav-btn:hover {
    background-color: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.nav-profile {
    display: flex;
    align-items: flex-end;
    /* Add margin-left for spacing between About Us button and profile */
    margin-left: 15px;
    /* Keep it from shrinking */
    flex-shrink: 0;
}

.nav-profile-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #2e7d32;
    transition: all 0.3s ease;
}

.nav-profile-img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(46, 125, 50, 0.6);
}

/* Logo styling */
.logo {
    display: block;
    margin: 20px auto;
    max-width: 150px;
    height: auto;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.7));
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    background-color: #e8f5e9; /* Light green background */
    color: #333;
    background-image: url('../images/rainforest1.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(160, 180, 160, 0.85); /* Even darker green with opacity */
    z-index: -1;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
}

h1, h2 {
    color: #1b5e20;
    border-bottom: 1px solid rgba(76, 175, 80, 0.2);
    padding-bottom: 10px;
}

/* Hero Section Styles */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)), url('../images/rainforest1.png') center/cover no-repeat;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-section h1 {
    font-size: 2.5em;
    color: #ffffff;
    margin-bottom: 15px;
    border-bottom: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.subtitle {
    font-size: 1.8em;
    color: #ffffff;
    font-weight: 300;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: none;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.lead-text {
    font-size: 1.2em;
    line-height: 1.6;
    color: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Feature Section Styles */
.feature-section {
    background-color: rgba(220, 237, 200, 0.7);
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(76, 175, 80, 0.2);
    backdrop-filter: blur(3px);
}

.feature-section h2 {
    color: #1b5e20;
    font-size: 1.8em;
    margin-top: 0;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.feature-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(76, 175, 80, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.feature-item h3 {
    color: #2e7d32;
    margin-top: 0;
}

.info {
    background-color: rgba(232, 245, 233, 0.8);
    padding: 25px;
    border-radius: 15px;
    margin-top: 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    border: 1px solid rgba(76, 175, 80, 0.2);
    backdrop-filter: blur(3px);
}

/* Feature List Styles */
.feature-list {
    list-style-type: none;
    padding-left: 0;
    margin-top: 20px;
}

.feature-list li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    position: relative;
    padding-left: 30px;
    border: 1px solid rgba(76, 175, 80, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-list li:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 7px rgba(0,0,0,0.12);
}

.feature-list li:before {
    content: "✓";
    color: #2e7d32;
    font-weight: bold;
    position: absolute;
    left: 10px;
}

.feature-list li strong {
    color: #1b5e20;
    margin-right: 5px;
}

/* Call to Action and Tagline Styles */
.cta-text {
    font-size: 1.2em;
    color: #000000;
    margin: 25px 0;
    text-align: center;
    text-shadow: none;
}

.tagline {
    font-style: italic;
    color: #2e7d32;
    text-align: center;
    margin-top: 30px;
    font-size: 1.1em;
    border-top: 1px solid rgba(76, 175, 80, 0.2);
    padding-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(76, 175, 80, 0.15);
}

th {
    background-color: rgba(76, 175, 80, 0.2);
    color: #1b5e20;
}

tr:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

.footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9em;
    color: #1b5e20;
    background-color: rgba(232, 245, 233, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    position: relative;
}

/* Bottom Links Section */
.bottom-links-section {
    margin-top: 30px;
    padding: 10px 15px;
    background-color: rgba(232, 245, 233, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.bottom-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottom-logo {
    display: flex;
    align-items: center;
}

.bottom-logo-img {
    height: 50px !important; /* Reduced from 75px to ensure it's not too big */
    width: 50px !important; /* Setting explicit width to match height */
    max-height: 50px !important; /* Matching the height */
    max-width: 50px !important; /* Matching the width */
    min-height: 50px !important; /* Ensuring minimum height */
    min-width: 50px !important; /* Ensuring minimum width */
    object-fit: contain !important; /* Ensures the image maintains its aspect ratio */
    display: block !important; /* Prevents inline display issues */
    box-sizing: border-box !important; /* Ensures padding and border are included in the element's dimensions */
    flex-shrink: 0 !important; /* Prevents the image from shrinking */
    flex-grow: 0 !important; /* Prevents the image from growing */
}

.bottom-links-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.bottom-links a {
    color: #1b5e20;
    font-weight: bold;
    text-decoration: none;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.bottom-links a:hover {
    color: #2e7d32;
    transform: translateX(-3px);
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: #2e7d32;
    color: white;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.cta-button-container {
    text-align: center;
    margin: 30px 0;
}

.btn-strava {
    background-color: #fc4c02; /* Strava orange */
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-strava:hover {
    background-color: #e34402;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #1b5e20;
    font-weight: bold;
}

/* Horizontal form layout */
.form-row {
    display: flex;
    align-items: center;
}

.form-row label {
    display: inline-block;
    width: 180px;
    margin-right: 10px;
    margin-bottom: 0;
}

input[type="text"], 
input[type="email"], 
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* Override width for subscriber fields */
#subscriberName {
    width: 300px; /* Approximate width for size="50" */
}

#subscriberEmail {
    width: 600px; /* Approximate width for size="100" */
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.5), inset 0 1px 3px rgba(0,0,0,0.1);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Gallery Carousel Styles */
.gallery-section {
    text-align: right;
}

.carousel-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 24px !important; /* Reduced by 60% from 60px to 24px */
}

.carousel-text {
    flex: 1 !important;
    text-align: left !important;
    padding-left: 24px !important; /* Reduced by 60% from 60px to 24px */
    margin-left: 24px !important; /* Reduced by 60% from 60px to 24px */
}

.carousel-text p {
    font-size: 1.1em;
    line-height: 1.5;
    color: #1b5e20;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid rgba(76, 175, 80, 0.15);
}

.slick-carousel {
    /* Width and height will be set by JavaScript */
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    flex: 0 0 auto !important; /* Don't grow or shrink */
}

.carousel-image {
    width: 100%;
    /* Height will be set by JavaScript */
    object-fit: contain;
    object-position: center;
}

/* Slick Carousel Custom Styles */
.slick-prev, 
.slick-next {
    z-index: 10;
    width: 50px;
    height: 50px;
    background-color: rgba(46, 125, 50, 0.7);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.slick-prev:hover, 
.slick-next:hover {
    background-color: rgba(46, 125, 50, 0.9);
}

.slick-prev:before, 
.slick-next:before {
    font-size: 24px;
    opacity: 1;
}

.slick-prev {
    left: 10px;
}

.slick-next {
    right: 10px;
}

.slick-dots {
    bottom: 10px;
}

.slick-dots li button:before {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.slick-dots li.slick-active button:before {
    color: white;
    opacity: 1;
}

/* Fix for Slick carousel in responsive layouts */
.slick-slide {
    outline: none;
}

.slick-slide img {
    display: block;
    width: 100%;
    border-radius: 0; /* Remove rounding from image corners */
}

/* Responsive Navigation (Hamburger) */
/* Hidden on desktop; shown on small screens */
.nav-toggle {
    display: none;
    margin-left: auto; /* push to the right on the same row as logo */
    /* Ensure a large tap target on mobile (iOS HIG recommends 44x44) */
    width: 44px;
    height: 44px;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    align-items: center;
    justify-content: center;
    flex-direction: column; /* stack bars vertically for classic hamburger */
    -webkit-tap-highlight-color: transparent; /* iOS touch feedback */
    user-select: none;
    z-index: 1002; /* above dropdown menu (1000) */
}

.nav-toggle:focus {
    outline: 2px solid rgba(46, 125, 50, 0.4);
    outline-offset: 2px;
}

/* Improve visibility on light backgrounds */
@media (max-width: 900px) {
    .nav-toggle {
        border: 1px solid rgba(46, 125, 50, 0.25);
        background-color: rgba(255,255,255,0.6);
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    .nav-toggle:hover {
        background-color: rgba(255,255,255,0.85);
    }
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 4px; /* thicker for classic hamburger */
    background-color: #333; /* darker for traditional look and contrast */
    margin: 5px 0; /* classic spacing */
    border-radius: 2px;
    transition: opacity 0.25s ease; /* no transform since we won't morph to X */
}

/* Base adjustments to allow absolute-positioned mobile menu */
.nav-bar { position: relative; z-index: 3000; }

/* Mobile behavior */
@media (max-width: 900px) {
    .nav-logo-img { height: 56px; }

    .nav-toggle { display: flex; } /* flex to center bars inside 44x44 */

    /* Hide the horizontal menu by default on small screens */
    .nav-buttons {
        display: none;
        position: absolute;
        top: 70px;
        right: 20px; /* align with page/container side padding */
        flex-direction: column;
        gap: 8px;
        background-color: rgba(255, 255, 255, 0.98);
        border-radius: 10px;
        padding: 10px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        border: 1px solid rgba(76, 175, 80, 0.25);
        width: min(76vw, 300px); /* slightly narrower to avoid edge bleed on iPhone */
        z-index: 4000; /* ensure dropdown overlays other content */
    }

    /* Show when nav is open */
    .nav-bar.open .nav-buttons { display: flex; }

    /* Make each button full width inside the dropdown and prevent overflow */
    .nav-btn { 
        width: 100%; 
        max-width: 100%; 
        box-sizing: border-box; 
        text-align: center; 
        padding: 6px 12px; /* slightly reduced horizontal padding on mobile */
        height: auto; 
        min-height: 40px; /* comfortable tap target inside the dropdown */
    }

    /* Profile image spacing in dropdown */
    .nav-profile { margin-left: 0; margin-top: 6px; }

    /* Keep traditional hamburger when open (no morph) */
    .nav-bar.open .nav-toggle span:nth-child(1) { transform: none; }
    .nav-bar.open .nav-toggle span:nth-child(2) { opacity: 1; }
    .nav-bar.open .nav-toggle span:nth-child(3) { transform: none; }
}

/* Media queries for responsive layouts */
/* For very large screens (like AWS) - ensure row layout */
@media (min-width: 1200px) {
    .carousel-container {
        flex-direction: row !important; /* Force row layout on large screens */
        flex-wrap: nowrap !important; /* Prevent wrapping */
        align-items: flex-start !important; /* Align items at the top */
        gap: 24px !important; /* Reduced by 60% from 60px to 24px */
    }

    .carousel-text {
        flex: 1 !important; /* Take remaining space */
        padding-left: 24px !important; /* Reduced by 60% from 60px to 24px */
        margin-left: 24px !important; /* Reduced by 60% from 60px to 24px */
    }

    .slick-carousel {
        flex: 0 0 auto !important; /* Don't grow or shrink */
    }
}

/* For medium screens - ensure row layout */
@media (min-width: 769px) and (max-width: 1199px) {
    .carousel-container {
        flex-direction: row !important; /* Force row layout on medium screens */
        gap: 24px !important; /* Reduced by 60% from 60px to 24px */
    }

    .carousel-text {
        padding-left: 24px !important; /* Reduced by 60% from 60px to 24px */
        margin-left: 24px !important; /* Reduced by 60% from 60px to 24px */
    }
}

/* For small screens - stack elements */
@media (max-width: 768px) {
    .carousel-container {
        flex-direction: column !important; /* Stack elements on small screens */
        gap: 12px !important; /* Reduced by 60% from 30px to 12px */
    }

    .carousel-text {
        padding-left: 0 !important; /* Reset padding for stacked layout */
        margin-left: 0 !important; /* Reset margin for stacked layout */
        margin-top: 30px !important; /* Increased top margin for better spacing in stacked layout */
    }
}
