/* AegeanSwim - Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
    min-height: 100vh;
}

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

/* Header Styles */
header {
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(8, 145, 178, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #0891b2;
}

.favorites-counter {
    background: #f59e0b;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
}

/* Hero Section */
.hero {
    padding: 80px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0c4a6e 0%, #0891b2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: #0369a1;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Beach Finder Section */
.beach-finder {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(8, 145, 178, 0.15);
    margin: 0 auto 50px;
    max-width: 700px;
}

.beach-finder h3 {
    color: #0c4a6e;
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.finder-form {
    display: grid;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #0369a1;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select,
.form-group input {
    padding: 15px;
    border: 2px solid #e0f2fe;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #0891b2;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.find-beaches-btn {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 18px 30px;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.find-beaches-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.find-beaches-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-title {
    color: #0c4a6e;
    font-size: 1.4rem;
    font-weight: 600;
}

.weather-info {
    background: rgba(255,255,255,0.9);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    color: #0369a1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.beach-results {
    display: grid;
    gap: 20px;
}

.beach-result {
    background: white;
    padding: 25px;
    border-radius: 16px;
    border-left: 5px solid #0891b2;
    transition: all 0.3s ease;
    position: relative;
}

.beach-result:hover {
    transform: translateX(5px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.15);
}

.top-recommendation {
    border-left-color: #10b981;
    border-left-width: 6px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.top-recommendation::before {
    content: "🏆 BEST CHOICE";
    position: absolute;
    top: -12px;
    left: 20px;
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.beach-header {
    margin-bottom: 15px;
}

.beach-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0c4a6e;
}

.beach-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.beach-metric {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0891b2;
}

.metric-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.beach-description {
    color: #64748b;
    line-height: 1.6;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.protection-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #10b981;
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 10px;
}

.protection-badge.moderate {
    background: #f59e0b;
}

.protection-badge.low {
    background: #ef4444;
}

.donate-nav {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.donate-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

/* Features Section */
.features-section {
    padding: 60px 0;
    background: white;
    margin-top: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature-title {
    color: #0c4a6e;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.feature-description {
    color: #64748b;
    line-height: 1.5;
}

/* Donation Section Styles */
.donation-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    margin-top: 50px;
}

.donation-container {
    max-width: 1000px;
}

.donation-header {
    text-align: center;
    margin-bottom: 50px;
}

.donation-title {
    font-size: 2.5rem;
    color: #0c4a6e;
    margin-bottom: 15px;
    font-weight: 700;
}

.donation-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto;
}

.donation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.donation-info h3 {
    color: #0c4a6e;
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.donation-list {
    list-style: none;
    padding: 0;
}

.donation-list li {
    padding: 12px 0;
    color: #64748b;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.donation-list li:before {
    content: "✓";
    color: #10b981;
    font-weight: bold;
    margin-right: 12px;
    font-size: 1.2rem;
}

.donation-options h3 {
    color: #0c4a6e;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.donation-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.amount-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(8, 145, 178, 0.3);
}

.custom-amount {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
}

.custom-amount input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0f2fe;
    border-radius: 12px;
    font-size: 1rem;
}

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

.paypal-btn {
    display: inline-block;
    background: #0070ba;
    color: white;
    padding: 15px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.paypal-btn:hover {
    background: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 112, 186, 0.3);
}

.paypal-logo {
    font-weight: 700;
    margin-right: 8px;
}

.progress-section {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-size: 1.2rem;
    color: #0c4a6e;
    font-weight: 600;
}

.progress-amount {
    font-size: 1.3rem;
    color: #0891b2;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    width: 35%;
    height: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    transition: width 0.5s ease;
}

.progress-percentage {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.progress-description {
    color: #64748b;
    line-height: 1.6;
}

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

.other-options h4 {
    color: #0c4a6e;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.other-payment-methods {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.payment-method {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #0c4a6e;
    font-weight: 600;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: #0891b2;
    color: #0891b2;
    transform: translateY(-2px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Navigation */
    .nav-links {
        gap: 15px;
        font-size: 14px;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* Hero Section */
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Beach Finder */
    .beach-finder {
        padding: 20px;
    }

    .beach-finder h3 {
        font-size: 1.3rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .find-beaches-btn {
        font-size: 1rem;
        padding: 14px 28px;
    }

    /* Beach Cards */
    .beach-card {
        padding: 20px;
    }

    .beach-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .beach-card h4 {
        font-size: 1.3rem;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 25px;
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    .feature-title {
        font-size: 1.3rem;
    }

    /* Results Section */
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-title {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    /* Donation Section */
    .donation-section {
        padding: 40px 0;
    }

    .donation-title {
        font-size: 1.8rem;
    }

    .donation-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .donation-amount-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .amount-btn {
        padding: 12px;
        font-size: 1rem;
    }

    /* Safety Section - Mobile Optimized */
    .safety-section {
        padding: 40px 0;
        margin: 40px 0;
    }

    .safety-section h2 {
        font-size: 1.8rem !important;
        padding: 0 15px;
        line-height: 1.3;
    }

    .safety-stats {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .stat-card {
        padding: 25px 20px;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .stat-label {
        font-size: 1rem;
    }

    .stat-detail {
        font-size: 0.85rem;
    }

    .safety-content {
        padding: 25px 20px;
        margin: 0 15px;
    }

    .safety-info h3 {
        font-size: 1.4rem;
        margin-top: 25px;
    }

    .safety-info p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .safety-list li {
        font-size: 0.95rem;
        padding-left: 25px;
        margin-bottom: 12px;
    }

    .safety-alert {
        padding: 20px;
        margin: 0 -5px;
    }

    .safety-alert h4 {
        font-size: 1.1rem;
    }

    .safety-alert p {
        font-size: 0.9rem;
    }

    /* Container padding for better mobile spacing */
    .container {
        padding: 0 20px;
    }

    /* Footer */
    footer {
        padding: 25px 0 !important;
        font-size: 0.9rem;
    }

    footer p {
        font-size: 0.9rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 10px;
        font-size: 12px;
    }

    .donation-amount-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2rem;
    }

    .safety-section h2 {
        font-size: 1.5rem !important;
    }

    .beach-finder {
        padding: 15px;
    }

    .container {
        padding: 0 15px;
    }
}

/* Safety Section Styles */
.safety-section {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    padding: 60px 0;
    margin: 60px 0;
}

.safety-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid #dc2626;
    transition: transform 0.3s ease;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-detail {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 10px;
}

.safety-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.safety-info h3 {
    color: #0c4a6e;
    font-size: 1.8rem;
    margin-bottom: 15px;
    margin-top: 30px;
}

.safety-info h3:first-child {
    margin-top: 0;
}

.safety-info p {
    color: #374151;
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.safety-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.safety-list li {
    color: #374151;
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}

.safety-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #059669;
    font-weight: bold;
    font-size: 1.2rem;
}

.safety-alert {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 5px solid #f59e0b;
    border-radius: 10px;
    padding: 25px;
    margin-top: 30px;
}

.safety-alert h4 {
    color: #92400e;
    font-size: 1.3rem;
    margin-bottom: 10px;
    margin-top: 0;
}

.safety-alert p {
    color: #78350f;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: none;
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.toast.show {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Image Optimization Styles
   ========================================================================== */

/* Optimized image container */
.optimized-image {
    display: block;
    position: relative;
    overflow: hidden;
    background-color: #e0f2fe;
}

/* Lazy loaded images */
.lazy-image {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
    filter: blur(10px);
    transform: scale(1.05);
}

/* Image loading state */
.lazy-image.loading {
    opacity: 0.5;
}

/* Image loaded state - blur-up effect */
.lazy-image.loaded {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* Image error state */
.lazy-image.error {
    opacity: 1;
    filter: grayscale(100%);
}

/* Skeleton placeholder */
.image-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #e0f2fe 0%,
        #bae6fd 50%,
        #e0f2fe 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Aspect ratio containers for preventing layout shift */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.aspect-ratio-3-2 {
    aspect-ratio: 3 / 2;
}

/* Image with fixed aspect ratio */
.optimized-image[data-aspect] {
    position: relative;
}

.optimized-image[data-aspect]::before {
    content: '';
    display: block;
}

.optimized-image[data-aspect="16:9"]::before {
    padding-top: 56.25%;
}

.optimized-image[data-aspect="4:3"]::before {
    padding-top: 75%;
}

.optimized-image[data-aspect="1:1"]::before {
    padding-top: 100%;
}

.optimized-image[data-aspect] .lazy-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive image gallery grid */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.image-gallery .optimized-image {
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery .optimized-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Hero/Banner images */
.hero-image {
    width: 100%;
    max-height: 60vh;
    object-fit: cover;
}

/* Beach card images */
.beach-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

/* Thumbnail images */
.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* Full-width responsive images */
.responsive-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Image with caption */
.image-with-caption {
    position: relative;
}

.image-with-caption figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    font-size: 14px;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lazy-image {
        transition: none;
        filter: none;
        transform: none;
    }

    .lazy-image.loaded {
        filter: none;
        transform: none;
    }

    .image-skeleton {
        animation: none;
    }
}
