@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    /* Light Mode Defaults */
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --text-color: #333;
    --text-color-light: #555; /* Lighter text for paragraphs */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --footer-bg: #e9ecef;
    --button-hover-bg: #5a0eae;
    --gradient-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --header-bg: var(--gradient-bg);
    --header-text: white;
    --section-title-color: var(--primary-color);
    --section-title-underline: var(--secondary-color);
    --feature-bg: white;
    --feature-shadow: 0 10px 30px rgba(0,0,0,0.08);
    --screenshot-bg: var(--bg-color);
    --download-bg: var(--bg-color);
    --footer-text-color: var(--text-color);
    --hero-bg: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,50 Q50,0 100,50 T200,50" fill="none" stroke="rgba(106, 17, 203, 0.1)" stroke-width="1"/><path d="M0,60 Q50,20 100,60 T200,60" fill="none" stroke="rgba(37, 117, 252, 0.1)" stroke-width="1"/></svg>'), var(--bg-color);
    --hero-image-shadow: 0 10px 30px rgba(0,0,0,0.15);
    --lang-switch-btn-bg-active: rgba(255, 255, 255, 0.2);
    --theme-toggle-btn-color: white;
}

/* Dark Mode Styles */
body.dark-mode {
    --primary-color: #9b59b6; /* Adjusted purple */
    --secondary-color: #3498db; /* Adjusted blue */
    --text-color: #e0e0e0;
    --text-color-light: #bdc3c7;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --footer-bg: #1a1a1a;
    --button-hover-bg: #8e44ad;
    --gradient-bg: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --header-bg: #1f1f1f;
    --header-text: #e0e0e0;
    --section-title-color: var(--primary-color);
    --section-title-underline: var(--secondary-color);
    --feature-bg: #1e1e1e;
    --feature-shadow: 0 10px 30px rgba(255,255,255,0.05);
    --screenshot-bg: var(--bg-color);
    --download-bg: var(--bg-color);
    --footer-text-color: #bdc3c7;
    --hero-bg: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,50 Q50,0 100,50 T200,50" fill="none" stroke="rgba(155, 89, 182, 0.1)" stroke-width="1"/><path d="M0,60 Q50,20 100,60 T200,60" fill="none" stroke="rgba(52, 152, 219, 0.1)" stroke-width="1"/></svg>'), var(--bg-color);
    --hero-image-shadow: 0 10px 30px rgba(255,255,255,0.1);
    --lang-switch-btn-bg-active: rgba(255, 255, 255, 0.1);
    --theme-toggle-btn-color: #e0e0e0;
}

body {
    /* ... existing styles ... */
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease; /* Add transition */
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Header & Navigation */
header {
    background: var(--header-bg);
    color: var(--header-text);
    background: var(--gradient-bg);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.1);
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
}

.lang-switch button,
#theme-toggle { /* Apply to theme toggle too */
    background: none;
    border: none;
    color: var(--theme-toggle-btn-color); /* Use variable */
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    margin: 0 0.2rem;
    opacity: 0.7;
    transition: opacity 0.3s ease, background-color 0.3s ease;
}

.lang-switch button.active {
    opacity: 1;
    font-weight: 600;
    background-color: var(--lang-switch-btn-bg-active); /* Use variable */
    border-radius: 4px;
}

.lang-switch button:hover {
    opacity: 1;
}

.lang-switch span {
    opacity: 0.7;
}

/* Main Content Sections */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    padding: 4rem 0;
    text-align: center;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--section-title-color); /* Use variable */
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--section-title-underline); /* Use variable */
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Hero Section */
#hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 6rem 0;
    min-height: 80vh;
    background: var(--hero-bg); /* Use variable */
    background-size: cover;
    background-position: center;
    animation: subtle-bg-animation 20s linear infinite alternate;
}

/* Hero Content Animation */
.hero-content {
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Feature Item Animation */
.feature-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

.feature-item:nth-child(1) {
    animation-delay: 0.2s;
}

.feature-item:nth-child(2) {
    animation-delay: 0.4s;
}

.feature-item:nth-child(3) {
    animation-delay: 0.6s;
}

.feature-item:nth-child(4) {
    animation-delay: 0.8s;
}

/* Download Button Animation */
.download-button {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: pulse 2s infinite;
    background-color: #121212; /* Use variable */
}

.download-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.219);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* CTA Button Animation */
.cta-button {
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Logo Animation */
.logo img {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Feature Image Animation */
.feature-item img {
    transition: transform 0.3s ease;
}

.feature-item:hover img {
    transform: scale(1.1);
}

/* Screenshot Animation */
.screenshot-gallery img {
    transition: transform 0.3s ease;
}

.screenshot-gallery img:hover {
    transform: scale(1.05);
}


/* Header Animation */
header {
    transition: box-shadow 0.3s ease;
}

header:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Scroll Animation */
@keyframes scrollAnimation {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Trigger Animation */
.scroll-trigger {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.scroll-trigger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Delay Animation */
.scroll-trigger.delay-1 {
    transition-delay: 0.2s;
}

.scroll-trigger.delay-2 {
    transition-delay: 0.4s;
}

.scroll-trigger.delay-3 {
    transition-delay: 0.6s;
}

@keyframes subtle-bg-animation {
    from { background-position: 0% 50%; }
    to { background-position: 100% 50%; }
}

.hero-content {
    max-width: 50%;
    animation: slideInLeft 1s ease-out;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--section-title-color); /* Use variable, consistent with section titles */
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color-light); /* Use variable */
}

.cta-button {
    display: inline-block;
    background: var(--gradient-bg);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--download-button-shadow-hover); /* Use variable */
    background: linear-gradient(135deg, var(--button-hover-bg) 0%, var(--secondary-color) 100%);
}

.hero-image {
    max-width: 45%;
    animation: fadeIn 1.5s ease-out;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--hero-image-shadow); /* Use variable */
}

/* Features Section */
#features {
    background-color: var(--feature-bg); /* Use variable */
    background-color: white;
    padding: 4rem 2rem;
    border-radius: 15px;
    margin-top: -50px; /* Overlap with hero */
    position: relative;
    z-index: 10;
    box-shadow: var(--feature-shadow); /* Use variable */
    transition: background-color 0.3s ease; /* Add transition */
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0; /* Start hidden for animation */
}

/* Stagger animation */
.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.feature-item img {
    max-height: 200px; /* Adjust as needed */
    width: auto;
    max-width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.feature-item h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.feature-item p {
    font-size: 1rem;
    color: #666;
}

/* Screenshots Section */
#screenshots {
    background-color: var(--screenshot-bg); /* Use variable */
    padding-top: 6rem;
}

.screenshot-gallery {
    display: flex;
    justify-content: center;
    align-items: center; /* Align items vertically */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 1.5rem;
    margin-top: 3rem;
}

.screenshot-gallery img {
    max-height: 400px; /* Adjust height */
    width: auto;
    max-width: 45%; /* Adjust width relative to container */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Indicate interactivity */
    animation: scaleIn 0.5s ease-out forwards;
    opacity: 0; /* Start hidden for animation */
}

/* Stagger animation */
.screenshot-gallery img:nth-child(1) { animation-delay: 0.1s; }
.screenshot-gallery img:nth-child(2) { animation-delay: 0.2s; }
.screenshot-gallery img:nth-child(3) { animation-delay: 0.3s; }
.screenshot-gallery img:nth-child(4) { animation-delay: 0.4s; }

.screenshot-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* Download Section */
#download {
    background-color: var(--download-bg); /* Use variable */
    background: var(--gradient-bg);
    color: white;
    padding: 5rem 2rem;
    margin-top: 4rem;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

#download::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    animation: rotate 30s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#download h2,
#download p {
    color: white;
    position: relative;
    z-index: 1;
}

#download h2::after {
    background: white;
}

#download p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}



/* Add icons (requires Font Awesome or similar) */
/* Example: .download-button.apple::before { content: '\f179'; font-family: 'Font Awesome 5 Brands'; margin-right: 0.5rem; } */

/* Footer */
footer {
    background-color: var(--footer-bg);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 4rem;
    color: var(--footer-text-color); /* Use variable */
    font-size: 0.9rem;
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    transition: opacity 0.3s ease;
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1002;
}

.close:hover {
    color: #bbb;
    transform: scale(1.2);
}

/* Dark mode adjustments */
body.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.95);
}

/* Animations */
@keyframes slideInLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Responsive Design */
@media (max-width: 992px) {
    #hero {
        flex-direction: column;
        text-align: center;
        padding: 4rem 0;
    }
    .hero-content,
    .hero-image {
        max-width: 80%;
        margin-bottom: 2rem;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .hero-content p {
        font-size: 1.1rem;
    }
    .screenshot-gallery img {
        max-width: 48%; /* Adjust for smaller screens */
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .cta-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    section h2 {
        font-size: 2rem;
    }
    .feature-grid {
        grid-template-columns: 1fr; /* Stack features */
    }
    .feature-item img {
        display: none; /* Hide feature images on small screens */
    }
    .screenshot-gallery {
        flex-direction: column; /* Stack screenshots */
        align-items: center;
    }
    .screenshot-gallery img {
        max-width: 80%; /* Larger width when stacked */
        max-height: none; /* Allow natural height */
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }
    nav {
        padding: 0 1rem;
    }
    main {
        padding: 1rem;
    }
    #hero {
        padding: 3rem 0;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    section {
        padding: 2rem 0;
    }
    #features {
        padding: 3rem 1rem;
    }
    .feature-item {
        padding: 1.5rem;
    }
    #download {
        padding: 3rem 1rem;
    }
    footer {
        padding: 1rem 0;
    }
}

/* Preview Section Text Color Fix */
#preview .card .content div,
#preview .card .content p {
    color: var(--text-color);
}
