/* сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ОПРЕДЕЛЕНИЕ ПЕРЕМЕННЫХ */
:root {
    /* --- СВЕТЛАЯ ТЕМА (Default) --- */
    --primary-color: #4CAF50;
    --secondary-color: #555555;          /* Темно-серый для втор. текста */
    --accent-orb: #2196F3;               /* Синий для фоновых шаров */
    --bg-body: #f0f2f5;                  /* Светлый фон */
    --text-main: #1a1a1a;                /* Темный текст */
    --card-bg: rgba(255, 255, 255, 0.85);/* Светлые карточки */
    --card-border: rgba(0, 0, 0, 0.1);   /* Серые границы */
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --menu-btn-bg: rgba(255, 255, 255, 0.9);
    --menu-line: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --hover-bg: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* --- ТЕМНАЯ ТЕМА (Original Neon) --- */
        --primary-color: #4CAF50;
        --secondary-color: #b3d9ff;      /* Светло-голубой для втор. текста */
        --accent-orb: #b3d9ff;           /* Цвет шаров для темной темы */
        --bg-body: #000000;              /* Черный фон */
        --text-main: #ffffff;            /* Белый текст */
        --card-bg: rgba(255, 255, 255, 0.08);
        --card-border: rgba(255, 255, 255, 0.15);
        --sidebar-bg: rgba(0, 0, 0, 0.95);
        --menu-btn-bg: rgba(255, 255, 255, 0.08);
        --menu-line: #ffffff;
        --shadow-color: rgba(76, 175, 80, 0.2);
        --input-bg: rgba(255, 255, 255, 0.08);
        --hover-bg: rgba(255, 255, 255, 0.12);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float-orb 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-orb));
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #667eea, var(--primary-color));
    bottom: -50px;
    right: -50px;
    animation-delay: 5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, var(--accent-orb), #667eea);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(30px, 50px) scale(1.05); }
}

/* Menu Button */
.menu-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--menu-btn-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    z-index: 1001;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-button:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
}

.menu-line {
    width: 22px;
    height: 2px;
    background: var(--menu-line);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-button.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-button.active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-button.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--card-border);
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-orb));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-menu {
    padding: 30px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--secondary-color);
    text-decoration: none;
    padding: 16px 25px;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.menu-item:hover {
    background: var(--hover-bg);
    color: var(--text-main);
    border-left-color: var(--primary-color);
    padding-left: 30px;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.language-selector {
    padding: 25px;
    border-top: 1px solid var(--card-border);
}

.language-selector select {
    width: 100%;
    background: var(--input-bg);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    background: var(--hover-bg);
}

.language-selector select option {
    background: var(--bg-body);
    color: var(--text-main);
}

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

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 80px;
    animation: fadeInUp 0.8s ease-out;
}

.logo {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-orb) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: -2px;
    animation: glow-text 3s ease-in-out infinite;
}

.tagline {
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin-bottom: 50px;
    max-width: 600px;
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: #ffffff; /* Всегда белый на кнопке */
    padding: 16px 40px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
    opacity: 0;
    animation: fadeIn 1s ease-out 0.6s forwards, pulse-button 2s ease-in-out 2s infinite;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.4);
}

.cta-button svg {
    width: 20px;
    height: 20px;
}

/* Floating Button */
.floating-cta {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: #ffffff;
    padding: 14px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
}

.floating-cta.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.floating-cta:hover {
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 15px 40px rgba(76, 175, 80, 0.5);
}

/* Features Grid */
.section {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    background: linear-gradient(135deg, var(--text-main), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.feature-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

.feature-card:hover {
    transform: translateY(-10px);
    background: var(--hover-bg);
    box-shadow: 0 20px 60px var(--shadow-color);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    border-radius: 16px;
    animation: bounce-icon 2s ease-in-out infinite;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

.feature-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
}

.feature-description {
    color: var(--secondary-color);
    line-height: 1.7;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.app-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.app-card:hover {
    transform: translateY(-8px);
    background: var(--hover-bg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin: 0 auto 20px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.1) rotate(5deg);
}

.app-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

.app-developer {
    font-size: 0.85rem;
    color: var(--secondary-color);
    opacity: 0.8;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

/* More Apps Button */
.more-apps-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.more-apps-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 14px 40px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.more-apps-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* App Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg); /* Теперь использует переменную */
    /* Для светлой темы фон должен быть непрозрачным, если card-bg прозрачный, добавим fallback */
    background-color: var(--bg-body); 
    backdrop-filter: blur(30px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    padding: 40px;
    position: relative;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(128, 128, 128, 0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(128, 128, 128, 0.2);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
    fill: var(--text-main);
}

.modal-header {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
}

.modal-icon {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.modal-info p {
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-main);
}

.stars {
    color: #ffd700;
}

.modal-description {
    margin: 25px 0;
    color: var(--secondary-color);
    line-height: 1.8;
}

.modal-versions {
    background: var(--hover-bg);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
}

.modal-versions h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-main);
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(128, 128, 128, 0.05);
    border-radius: 10px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-link:hover {
    transform: scale(1.05);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s ease;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px var(--shadow-color);
}

.project-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    border-radius: 16px;
}

.project-icon svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
}

.project-description {
    color: var(--secondary-color);
    margin-bottom: 25px;
    line-height: 1.7;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-main);
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* Stats Section */
.stats-section {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 60px 40px;
    margin: 80px 0;
    box-shadow: 0 4px 12px var(--shadow-color);
}

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

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-orb));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* About Text */
.about-text {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 50px 40px;
    margin: 60px 0;
    line-height: 1.9;
    font-size: 1.15rem;
    text-align: center;
    color: var(--text-main);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.version-highlight {
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: #ffffff;
    padding: 4px 14px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
    margin: 0 4px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(128, 128, 128, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes glow-text {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(76, 175, 80, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(76, 175, 80, 0.8));
    }
}

@keyframes pulse-button {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

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

/* Responsive */
@media (max-width: 768px) {
    .logo {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

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

@media (max-width: 480px) {
    .logo {
        font-size: 2.5rem;
    }

    .sidebar {
        width: 280px;
        left: -280px;
    }
}
