/* Reset and Premium Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #064e3b;
    --primary-light: #a7f3d0;
    --primary-dark: #022c22;
    --secondary-color: #10b981;
    --accent-color: #047857;
    --text-light: #ecfdf5;
    --text-dark: #064e3b;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    --gradient-hero: linear-gradient(135deg, #ecfdf5 0%, #a7f3d0 50%, #6ee7b7 100%);
    --shadow-soft: 0 8px 32px rgba(6, 78, 59, 0.1);
    --shadow-medium: 0 16px 48px rgba(6, 78, 59, 0.15);
    --shadow-large: 0 32px 64px rgba(6, 78, 59, 0.2);
    --border-radius: 16px;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
    background: var(--gradient-hero);
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.floating-island {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(6, 78, 59, 0.05));
    filter: blur(40px);
    animation: floatIsland 20s ease-in-out infinite;
}

.island-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.island-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 10%;
    animation-delay: -7s;
}

.island-3 {
    width: 120px;
    height: 120px;
    bottom: 20%;
    left: 20%;
    animation-delay: -14s;
}

/* Main Container */
.loading-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header Section - Improved Mobile Layout */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDownFade 1s ease-out;
    gap: 1rem;
}

.logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* BIGGER LOGO */
.main-logo {
    width: 120px;  /* Increased from 80px */
    height: 120px; /* Increased from 80px */
    object-fit: contain;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.campaign-wrapper {
    display: flex;
    align-items: center;
}

/* BIGGER CAMPAIGN IMAGE */
.campaign-image {
    width: 120px;  /* Increased from 80px */
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
}

/* Main Content Grid - Mobile First */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    flex: 1;
    width: 100%;
}

/* Text Content - Better Mobile Typography */
.text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: slideUpFade 1s ease-out 0.3s both;
    width: 100%;
}

.text-wrapper {
    max-width: 100%;
    padding: 0 1rem;
}

/* SMALLER MALAYALAM TEXT */
.main-heading {
    font-size: clamp(1.6rem, 7vw, 2.8rem); /* Reduced from larger values */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.heading-line {
    display: block;
    opacity: 0;
    animation: slideUpFade 0.8s ease-out forwards;
}

.heading-line:nth-child(1) { animation-delay: 0.5s; }
.heading-line:nth-child(2) { animation-delay: 0.7s; }
.heading-line:nth-child(3) { animation-delay: 0.9s; }

.heading-line.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* SMALLER SUB-HEADING */
.sub-heading {
    font-size: clamp(0.9rem, 3.5vw, 1.3rem); /* Reduced from larger values */
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: slideUpFade 0.8s ease-out 1.1s both;
}

.mission-text {
    opacity: 0;
    animation: slideUpFade 0.8s ease-out 1.3s both;
    max-width: 500px;
}

.mission-text p {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: var(--primary-dark);
    line-height: 1.5;
    font-weight: 400;
}

/* Enhanced Gallery - Better Mobile Grid */
.gallery-section {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.gallery-container {
    position: relative;
    width: 100%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: galleryItemAppear 0.6s ease-out var(--delay) both;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(16, 185, 129, 0.2), rgba(6, 78, 59, 0.1));
    opacity: 0;
    transition: var(--transition-smooth);
}

.image-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.item-glow {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-smooth);
    filter: blur(8px);
}

/* Enhanced Loading Section - Mobile Optimized */
.loading-section {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    animation: slideUpFade 1s ease-out 0.6s both;
}

.progress-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.progress-title {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.progress-percentage {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-track {
    position: relative;
    height: 12px;
    background: rgba(236, 253, 245, 0.8);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 1px 4px rgba(6, 78, 59, 0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 8px;
    position: relative;
    transition: width 0.3s ease;
}

.progress-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: waveShimmer 2s infinite linear;
}

.progress-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
}

.progress-dot {
    width: 3px;
    height: 3px;
    background: var(--white);
    border-radius: 50%;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
    text-align: center;
}

.stat {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.skip-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--primary-dark);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
}

/* Animations */
@keyframes floatIsland {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes galleryItemAppear {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes waveShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Gallery Item Hover Effects */
.gallery-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-medium);
}

.gallery-item:hover .image-overlay {
    opacity: 1;
}

.gallery-item:hover .image-shine {
    left: 100%;
}

.gallery-item:hover .item-glow {
    opacity: 0.3;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery Item Stagger Animation */
.gallery-item:nth-child(1) { --delay: 0.1s; }
.gallery-item:nth-child(2) { --delay: 0.15s; }
.gallery-item:nth-child(3) { --delay: 0.2s; }
.gallery-item:nth-child(4) { --delay: 0.25s; }
.gallery-item:nth-child(5) { --delay: 0.3s; }
.gallery-item:nth-child(6) { --delay: 0.35s; }
.gallery-item:nth-child(7) { --delay: 0.4s; }
.gallery-item:nth-child(8) { --delay: 0.45s; }
.gallery-item:nth-child(9) { --delay: 0.5s; }

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .loading-container {
        padding: 0.75rem;
        gap: 1rem;
        justify-content: space-between;
        min-height: 100vh;
    }
    
    .header-section {
        gap: 0.5rem;
    }
    
    /* BIGGER LOGO ON MOBILE */
    .main-logo {
        width: 100px;  /* Increased from smaller value */
        height: 100px; /* Increased from smaller value */
    }
    
    /* BIGGER CAMPAIGN IMAGE ON MOBILE */
    .campaign-image {
        width: 100px;  /* Increased from smaller value */
    }
    
    .main-content {
        gap: 1.5rem;
        flex: 1;
    }
    
    .text-wrapper {
        padding: 0 0.5rem;
    }
    
    /* SMALLER MALAYALAM TEXT ON MOBILE */
    .main-heading {
        font-size: 1.5rem; /* Reduced from larger value */
        margin-bottom: 0.75rem;
    }
    
    /* SMALLER SUB-HEADING ON MOBILE */
    .sub-heading {
        font-size: 0.95rem; /* Reduced from larger value */
        margin-bottom: 1rem;
    }
    
    .gallery-section {
        max-width: 400px;
    }
    
    .gallery-grid {
        gap: 0.5rem;
    }
    
    .gallery-item {
        border-radius: 8px;
    }
    
    .loading-section {
        max-width: 400px;
    }
    
    .progress-container {
        padding: 1.25rem;
    }
    
    .progress-header {
        margin-bottom: 0.75rem;
    }
    
    .progress-title {
        font-size: 0.9rem;
    }
    
    .progress-percentage {
        font-size: 1rem;
    }
    
    .progress-track {
        height: 10px;
        margin-bottom: 0.75rem;
    }
    
    .progress-stats {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .loading-container {
        padding: 0.5rem;
        gap: 0.75rem;
    }
    
    .header-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* BIGGER LOGO ON SMALL MOBILE */
    .main-logo, .campaign-image {
        width: 110px;  /* Increased from smaller value */
        height: 110px; /* Increased from smaller value */
    }
    
    .main-content {
        gap: 1rem;
    }
    
    .text-wrapper {
        padding: 0;
    }
    
    /* SMALLER MALAYALAM TEXT ON SMALL MOBILE */
    .main-heading {
        font-size: 1.4rem; /* Reduced from larger value */
        margin-bottom: 0.5rem;
    }
    
    /* SMALLER SUB-HEADING ON SMALL MOBILE */
    .sub-heading {
        font-size: 0.85rem; /* Reduced from larger value */
        margin-bottom: 0.75rem;
    }
    
    .mission-text p {
        font-size: 0.85rem;
    }
    
    .gallery-section {
        max-width: 320px;
    }
    
    .gallery-grid {
        gap: 0.4rem;
    }
    
    .gallery-item {
        border-radius: 6px;
    }
    
    .loading-section {
        max-width: 320px;
    }
    
    .progress-container {
        padding: 1rem;
    }
    
    .progress-header {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
    
    .skip-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 360px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }
    
    .progress-container {
        padding: 0.75rem;
    }
    
    /* EVEN SMALLER TEXT ON VERY SMALL DEVICES */
    .main-heading {
        font-size: 1.3rem; /* Further reduced */
    }
    
    .sub-heading {
        font-size: 0.8rem; /* Further reduced */
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
    
    .text-content {
        text-align: left;
        align-items: flex-start;
        flex: 1;
    }
    
    .gallery-section {
        flex: 1;
        max-width: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .main-content {
        flex-direction: row;
        align-items: center;
        gap: 3rem;
    }
    
    .text-content {
        text-align: left;
        align-items: flex-start;
        flex: 1;
    }
    
    .text-wrapper {
        padding: 0;
    }
    
    .gallery-section {
        flex: 1;
        max-width: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}