:root {
    --bg-color: #f5f5f7;
    --surface-color: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #0066cc;
    --accent-hover: #0077ed;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-color: #000000;
    --surface-color: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent-color: #0a84ff;
    --accent-hover: #006ee6;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

.nav-header {
    position: sticky;
    top: 0;
    background-color: rgba(var(--surface-color), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-color);
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.8;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.icon-btn:hover {
    background-color: var(--border-color);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

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

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-section {
    margin-bottom: 48px;
}

.app-section h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.app-card {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: 1px solid var(--border-color);
}

/* ====== ПОДВАЛ (FOOTER) ====== */
.site-footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-secondary);
    text-align: center;
    margin-top: 40px;
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.footer-content p {
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-links {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.9rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 6px 12px;
    border-radius: 12px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.contact-link:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .app-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.app-icon-large {
    width: 128px;
    height: 128px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.app-icon img, 
.app-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-info {
    flex-grow: 1;
    min-width: 0;
}

.app-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-dropdown {
    position: relative;
}

.lang-btn {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.lang-btn:hover {
    background-color: var(--bg-color);
}

.lang-btn:active {
    transform: scale(0.95);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 200;
}

[data-theme="dark"] .lang-menu {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lang-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.img-wrapper {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: start;
    flex-shrink: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .img-wrapper { height: 300px; }
}

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

.img-wrapper.loading::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, 
        rgba(150, 150, 150, 0.1) 25%, 
        rgba(150, 150, 150, 0.2) 50%, 
        rgba(150, 150, 150, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    z-index: 1;
}

.img-wrapper img {
    height: 100%;
    width: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: pointer;
}

.img-wrapper img.loaded {
    opacity: 1;
    position: relative;
    z-index: 2;
}

.gallery-scroll > img {
    display: none; 
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 10000;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lang-option {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 12px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
}

.lang-option:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.lang-option.active {
    color: var(--accent-color);
    background-color: var(--bg-color);
    font-weight: 600;
}

.get-btn {
    background-color: var(--bg-color);
    color: var(--accent-color);
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.get-btn:active {
    transform: scale(0.95);
}

.app-detail-container {
    padding-top: 20px;
}

.app-header-hero {
    display: flex;
    gap: 32px;
    margin-bottom: 40px;
    align-items: center;
}

.app-hero-info h1 {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.app-hero-info h2 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 20px;
}

.download-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-color);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.download-btn:hover {
    background-color: var(--accent-hover);
}

.download-btn:active {
    transform: scale(0.96);
}

.secondary-btn {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background-color: var(--bg-color);
}

.gallery-container {
    margin-bottom: 40px;
}

.gallery-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-scroll::-webkit-scrollbar {
    display: none;
}

.gallery-scroll img {
    height: 400px;
    border-radius: 12px;
    scroll-snap-align: start;
    object-fit: contain;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.app-description {
    background-color: var(--surface-color);
    padding: 32px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.app-description h3 {
    margin: 32px 0 16px;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.app-description p {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.lead-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary) !important;
}

.feature-list {
    list-style: none;
}

.feature-list li {
    margin-bottom: 16px;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-color);
}

.feature-list strong {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .app-header-hero {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .download-group {
        justify-content: center;
    }
    
    .gallery-scroll img {
        height: 300px;
    }

    .app-description {
        padding: 20px;
    }
}