/* Base Styles & Reset */
:root {
    /* Light Theme (Default) */
    --primary-color: #644FDA;
    --primary-dark: #007AFF;
    --text-color: #333333;
    --light-text: #666666;
    --background: #FAFAFA;
    --white: #FFFFFF;
    --border-color: #EEEEEE;
    --success-color: #34A853;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(100, 79, 218, 0.1);
    --heading-font: "Funnel Display", sans-serif;
    --body-font: "Funnel Display", -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    --hero-bg: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    --card-bg: var(--white);
    --footer-bg: var(--white);
    --cta-bg: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    --switch-bg: #e9e9e9;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-color: #e0e0e0;
    --light-text: #a0a0a0;
    --background: #121212;
    --white: #1e1e1e;
    --border-color: #333333;
    --shadow: 0 4px 12px rgba(100, 79, 218, 0.2);
    --hero-bg: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --card-bg: #252525;
    --footer-bg: #1a1a1a;
    --cta-bg: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    --switch-bg: #444444;
}

/* Theme Switch Styles */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.theme-switch {
    display: inline-block;
    position: relative;
    width: 60px;
    height: 30px;
    margin: 0 10px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--white);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.slider .icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    transition: .4s;
    color: var(--white);
}

.slider .icon-moon {
    right: 6px;
    opacity: 1;
}

.slider .icon-sun {
    left: 6px;
    opacity: 0;
}

input:checked + .slider .icon-moon {
    opacity: 0;
}

input:checked + .slider .icon-sun {
    opacity: 1;
}

.switch-label {
    font-size: 14px;
    color: var(--light-text);
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure all images don't cause overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for mobile horizontal scroll */
section, header, footer {
    width: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    font-optical-sizing: auto;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--light-text);
}

a {
    text-decoration: none;
    color: #644FDA;
    transition: all 0.3s ease;
}

a:hover {
    color: #007AFF;
}

section {
    padding: 5rem 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    color: #fff;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(100, 79, 218, 0.3);
}

.app-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 32px;
    justify-content: flex-start;
}

.app-button {
    display: inline-block;
    line-height: 0;
    max-width: 180px;
}

.app-button img {
    width: 180px;
    height: 50px;
    object-fit: contain;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Header/Navigation */
.hero {
    background: var(--hero-bg);
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
}

.logo img {
    height: 38px;
    width: auto;
}

.logo-text {
    font-family: var(--heading-font);
    font-weight: 600;
    font-size: 20px;
    color: #333;
}

[data-theme="dark"] .logo-text {
    color: #fff;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
    position: relative;
}

.subheadline {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-image {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 45%;
    max-width: 600px;
    z-index: 0;
}

.hero-image img {
    animation: scaleIn 1.2s ease-out 0.5s forwards;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Features Section */
.features {
    background-color: var(--card-bg);
    padding: 6rem 0;
}

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

.feature-item {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    background-color: var(--white);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon img {
    width: 64px;
    height: 64px;
}

/* Screenshots Section */
.screenshots {
    background-color: var(--background);
    padding: 6rem 0;
    overflow: visible;
}

.screenshots .container {
    overflow: visible;
    position: relative;
}

.screenshot-carousel {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow: visible;
    margin: 3rem 0 1.5rem;
    justify-content: center;
    padding: 0 20px;
}

.screenshot-item {
    flex: 0 0 300px;
    text-align: center;
    max-width: 300px;
    padding: 10px;
    background-color: transparent;
}

.screenshot-item p {
    color: var(--text-color);
    margin-top: 12px;
    font-weight: 500;
}

.screenshot-item img {
    border-radius: 24px;
    box-shadow: none;
    margin-bottom: 1rem;
    border: none;
    height: 500px;
    width: 280px;
    object-fit: contain;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
}

.prev-btn, .next-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.prev-btn:hover, .next-btn:hover {
    background: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    color: var(--white);
    border-color: transparent;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    transform: scale(1.2);
}

/* Use Cases Section */
.use-cases {
    background-color: var(--card-bg);
    padding: 6rem 0;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem;
    margin-top: 3rem;
}

.use-case-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    background-color: var(--white);
}

.use-case-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.use-case-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.use-case-icon img {
    width: 48px;
    height: 48px;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #644FDA 0%, #007AFF 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.cta h2, .cta p {
    color: var(--white);
}

.cta .app-buttons {
    justify-content: center;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    padding: 4rem 0 2rem;
    text-align: center;
}

.footer-logo {
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 36px;
}

.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.copyright {
    font-size: 0.875rem;
    color: var(--light-text);
}

/* Animation Styles */
.pre-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-in {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Apply animations to hero elements */
.hero h1 {
    animation: fadeIn 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero .subheadline {
    animation: fadeIn 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero .app-buttons {
    animation: fadeIn 1s ease-out 0.6s forwards;
    opacity: 0;
}

/* Scrolled State for Navbar */
.scrolled .navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    padding: 1rem 0;
}

/* Staggered animations for feature items */
.features-grid .feature-item:nth-child(1) {
    transition-delay: 0.1s;
}

.features-grid .feature-item:nth-child(2) {
    transition-delay: 0.2s;
}

.features-grid .feature-item:nth-child(3) {
    transition-delay: 0.3s;
}

.features-grid .feature-item:nth-child(4) {
    transition-delay: 0.4s;
}

.features-grid .feature-item:nth-child(5) {
    transition-delay: 0.5s;
}

/* Staggered animations for use case items */
.use-cases-grid .use-case-item:nth-child(1) {
    transition-delay: 0.1s;
}

.use-cases-grid .use-case-item:nth-child(2) {
    transition-delay: 0.2s;
}

.use-cases-grid .use-case-item:nth-child(3) {
    transition-delay: 0.3s;
}

.use-cases-grid .use-case-item:nth-child(4) {
    transition-delay: 0.4s;
}

.use-cases-grid .use-case-item:nth-child(5) {
    transition-delay: 0.5s;
}

.use-cases-grid .use-case-item:nth-child(6) {
    transition-delay: 0.6s;
}

/* Дополнительные задержки анимации для новых юз-кейсов */
.use-cases-grid .use-case-item:nth-child(7) {
    transition-delay: 0.7s;
}

.use-cases-grid .use-case-item:nth-child(8) {
    transition-delay: 0.8s;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .hero {
        height: auto;
        padding: 120px 0 80px;
    }
    
    .hero-image {
        position: relative;
        width: 100%;
        right: auto;
        bottom: auto;
        margin-top: 3rem;
    }
    
    .features-grid, 
    .use-cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero-content {
        text-align: center;
        margin: 0 auto;
    }
    
    .app-buttons {
        justify-content: center;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .features-grid, 
    .use-cases-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .screenshots {
        overflow: hidden;
    }
    
    .screenshot-carousel {
        display: block;
        padding: 0;
        transform: none !important;
        transition: none !important;
    }
    
    .screenshot-item {
        display: none;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .screenshot-item:first-child {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .screenshot-item img {
        width: 100%;
        max-width: 300px;
        height: auto;
        margin: 0 auto;
        display: block;
        opacity: 1 !important;
    }
    
    .carousel-nav {
        display: none;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 16px;
    }
    
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 0 60px;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .app-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .app-button {
        max-width: 160px;
    }

    .app-button img {
        width: 160px;
        height: 50px;
    }
}

.nav-cta {
    padding-right: 20px;
}

/* Falling Numbers Animation */
.falling-numbers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    opacity: 0.2;
    pointer-events: none;
}

.number {
    position: absolute;
    display: block;
    opacity: 0.4;
    font-family: var(--heading-font);
    font-weight: 700;
    color: #644FDA;
    animation-name: falling;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes falling {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Dark Mode Footer Links */
[data-theme="dark"] .footer-links a {
    color: #a0a0a0;
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--primary-color);
} 