/* ==================== LIVING MEMORIES - STUDIO STYLE ==================== */
/* Вдохновлено дизайном TryOn - пастельные тона, glassmorphism, минимализм */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Студийный фон */
    --studio-bg: #E8E6E3;
    --studio-bg-alt: #EAE8E5;

    /* Пастельная палитра */
    --mint: #b8dcc8;
    --mint-light: #d4ebe0;
    --lavender: #d4c4e0;
    --lavender-light: #e8dff0;
    --peach: #f5d5c8;
    --peach-light: #fae8e0;

    --text-dark: #2d3436;
    --text-muted: #636e72;
    --text-light: #9b9b9b;
    --white: #ffffff;
    --white-90: rgba(255, 255, 255, 0.9);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-50: rgba(255, 255, 255, 0.5);

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    /* Градиенты для разных сервисов */
    --btn-gradient: linear-gradient(135deg, #b7f3cb 0%, #c8b8ff 100%);
    --btn-gradient-restore: linear-gradient(135deg, #ffd9b3 0%, #ffb3b3 100%);
    --btn-gradient-dance: linear-gradient(135deg, #b3d4ff 0%, #e0b3ff 100%);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--studio-bg);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ==================== APP CONTAINER ==================== */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--studio-bg);
}

.container {
    max-width: 100%;
    padding: 0 16px;
}

/* ==================== HEADER ==================== */
.header {
    background: rgba(232, 230, 227, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

.navbar-menu {
    display: none;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.lang-btn {
    background: var(--white-70);
    border: 1px solid var(--white-50);
    padding: 5px 8px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--white-90);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--white-90);
    backdrop-filter: blur(10px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius-xs);
    display: none;
    min-width: 120px;
    box-shadow: var(--shadow-soft);
}

.lang-dropdown.show {
    display: block;
}

.lang-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.lang-dropdown a:hover {
    background: var(--white);
}

/* User Info in Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
}

.user-name {
    font-weight: 500;
    color: var(--text-dark);
    display: none;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-credits {
    background: var(--btn-gradient);
    color: var(--text-dark);
    padding: 4px 8px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.65rem;
    white-space: nowrap;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--btn-gradient);
    color: var(--text-dark);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(183, 243, 203, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline {
    background: var(--white-70);
    color: var(--text-dark);
    border: 1px solid var(--white-50);
}

.btn-outline:hover {
    background: var(--white-90);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 6px 10px;
    font-size: 0.75rem;
}

.btn-text:hover {
    color: var(--text-dark);
}

/* Hide logout on very small screens */
@media (max-width: 400px) {
    .navbar-actions .btn-text {
        display: none;
    }
}

.btn-telegram {
    background: #229ED9;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-telegram:hover {
    background: #1E8BC3;
    transform: translateY(-1px);
}

.btn-telegram svg {
    width: 18px;
    height: 18px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    padding: 20px 0;
}

/* ==================== SERVICES PAGE (INDEX) ==================== */
.services-page {
    min-height: calc(100vh - 140px);
    padding: 20px 16px;
}

.services-header {
    text-align: center;
    margin-bottom: 30px;
}

.services-header h1 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.services-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* User Welcome Badge - hidden on mobile to avoid duplication with header */
.user-welcome {
    display: none;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 18px;
    background: var(--white-70);
    backdrop-filter: blur(10px);
    border: 1px solid var(--white-50);
    border-radius: 30px;
    font-size: 0.9rem;
}

.user-welcome .credits-badge {
    background: var(--btn-gradient);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* Service Cards */
.service-card {
    background: var(--white-70);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--mint);
}

.service-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.service-card h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
}

.service-card .credits-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-card .credits-cost {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.service-card .arrow {
    width: 32px;
    height: 32px;
    background: var(--white-90);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.service-card:hover .arrow {
    background: var(--btn-gradient);
}

/* Coming Soon Badge */
.coming-soon-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--peach);
    color: var(--text-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Auth Section */
.auth-section {
    text-align: center;
    margin-top: 30px;
    padding: 28px;
    background: var(--white-70);
    backdrop-filter: blur(16px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.auth-section h3 {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.auth-section p {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 0.9rem;
}

#auth-waiting {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== UPLOAD PAGE (ANIMATE/RESTORE/DANCE) ==================== */
.upload-page {
    min-height: calc(100vh - 140px);
    padding: 16px;
}

.upload-container {
    max-width: 500px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 16px;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-dark);
}

.page-header {
    text-align: center;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* User Info Bar */
.user-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white-70);
    backdrop-filter: blur(10px);
    border: 1px solid var(--white-50);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.user-info-bar .credits {
    background: var(--btn-gradient);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Upload Form Card */
.upload-form {
    background: var(--white-70);
    backdrop-filter: blur(16px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius);
    padding: 24px;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    padding: 32px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--mint);
    background: var(--mint-light);
}

.upload-zone.has-file {
    border-color: var(--mint);
    background: var(--mint-light);
}

.upload-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.upload-zone h3 {
    color: var(--text-dark);
    margin-bottom: 6px;
    font-size: 1rem;
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.upload-zone input[type="file"] {
    display: none;
}

/* Preview Container */
.preview-container {
    display: none;
    margin-bottom: 16px;
    text-align: center;
}

.preview-container.show {
    display: block;
}

.preview-image {
    max-width: 100%;
    max-height: 250px;
    border-radius: var(--radius-sm);
    margin: 0 auto;
    display: block;
    box-shadow: var(--shadow-soft);
}

.remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #e74c3c;
    color: white;
}

/* Prompt Section */
.prompt-section {
    margin-bottom: 16px;
}

.prompt-section label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.prompt-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--white-50);
    background: var(--white-90);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.prompt-section textarea:focus {
    outline: none;
    border-color: var(--mint);
}

/* Prompt Hints */
.prompt-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.prompt-hint {
    background: var(--white-90);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.prompt-hint:hover {
    background: var(--btn-gradient);
    color: var(--text-dark);
}

/* Options Section (for restore page) */
.options-section {
    margin-bottom: 16px;
}

.options-section label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.option-card {
    background: var(--white-90);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-card:hover {
    border-color: var(--mint);
}

.option-card.selected {
    border-color: var(--mint);
    background: var(--mint-light);
}

.option-card input {
    display: none;
}

.option-card h4 {
    margin-bottom: 4px;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.option-card p {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--btn-gradient);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(183, 243, 203, 0.4);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(183, 243, 203, 0.5);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Credits Note */
.credits-note {
    text-align: center;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Error Message */
.error-msg {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
    padding: 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
    display: none;
    font-size: 0.85rem;
    text-align: center;
}

.error-msg.show {
    display: block;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(232, 230, 227, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--lavender-light);
    border-top-color: var(--lavender);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.loading-overlay h3 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.loading-overlay p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Result Section */
.result-section {
    display: none;
    text-align: center;
    padding: 24px;
    background: var(--white-70);
    backdrop-filter: blur(16px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius);
}

.result-section.show {
    display: block;
}

.result-section h2 {
    color: var(--text-dark);
    margin-bottom: 16px;
    font-size: 1.25rem;
}

.result-video {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.result-comparison img {
    width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

.result-comparison .label {
    text-align: center;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-download {
    background: var(--btn-gradient);
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(183, 243, 203, 0.4);
}

.btn-new {
    background: var(--white-90);
    color: var(--text-dark);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--white-50);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-new:hover {
    background: var(--white);
}

/* History Section */
.history-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.history-section h3 {
    color: var(--text-dark);
    margin-bottom: 14px;
    font-size: 0.95rem;
    font-weight: 600;
}

.history-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.history-grid::-webkit-scrollbar {
    display: none;
}

.history-item {
    flex: 0 0 80px;
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}

.history-item:hover {
    transform: scale(1.03);
    border-color: var(--mint);
    box-shadow: var(--shadow-soft);
}

.history-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Auth Required */
.auth-required {
    text-align: center;
    padding: 32px 20px;
    background: var(--white-70);
    backdrop-filter: blur(16px);
    border: 1px solid var(--white-50);
    border-radius: var(--radius);
}

.auth-required h3 {
    margin-bottom: 8px;
    color: var(--text-dark);
}

.auth-required p {
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* Dance Page Specifics */
.dance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.dance-card {
    position: relative;
    border: 2px solid transparent;
    border-radius: var(--radius-xs);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 9/16;
    background: var(--studio-bg-alt);
}

.dance-card:hover {
    border-color: var(--lavender);
    transform: scale(1.02);
}

.dance-card.selected {
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px var(--lavender-light);
}

.dance-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dance-card .dance-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 16px 4px 6px;
    color: white;
    font-size: 0.65rem;
    font-weight: 500;
    text-align: center;
}

@media (max-width: 480px) {
    .dance-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .dance-card .dance-name {
        font-size: 0.55rem;
        padding: 12px 2px 4px;
    }
}

/* ==================== FOOTER ==================== */
.footer {
    background: rgba(232, 230, 227, 0.8);
    padding: 16px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-dark);
}

.footer-copyright,
.footer-description {
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== SPINNER ==================== */
.spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid var(--lavender-light);
    border-top-color: var(--lavender);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

/* ==================== RESPONSIVE ==================== */

/* Extra small screens */
@media (max-width: 359px) {
    .navbar-brand .logo {
        font-size: 0.75rem;
    }

    .user-credits {
        padding: 3px 6px;
        font-size: 0.6rem;
    }

    .lang-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    .services-header h1 {
        font-size: 1.4rem;
    }
}

@media (min-width: 480px) {
    .container {
        max-width: 500px;
        margin: 0 auto;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .user-name {
        display: block;
    }

    /* Show user-welcome badge on larger screens */
    .user-welcome {
        display: inline-flex;
    }

    .history-item {
        flex: 0 0 100px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 600px;
        padding: 0 24px;
    }

    /* Header - tablet */
    .header {
        padding: 12px 0;
    }

    .header .container {
        max-width: 100%;
        padding: 0 24px;
    }

    .navbar {
        gap: 20px;
    }

    .navbar-brand .logo {
        font-size: 0.95rem;
    }

    .navbar-menu {
        display: flex;
        gap: 16px;
    }

    .navbar-menu a {
        color: var(--text-muted);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.8rem;
        transition: color 0.2s;
        white-space: nowrap;
    }

    .navbar-menu a:hover {
        color: var(--text-dark);
    }

    .navbar-actions {
        gap: 8px;
    }

    .lang-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .user-info {
        gap: 8px;
        font-size: 0.8rem;
    }

    .user-name {
        display: block;
        max-width: 100px;
        font-size: 0.8rem;
    }

    .user-credits {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .btn-text {
        font-size: 0.75rem;
        padding: 6px 8px;
    }

    .services-header h1 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 700px;
    }

    .service-card {
        padding: 28px;
    }

    .upload-form {
        padding: 28px;
    }

    .history-grid {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .history-item {
        flex: 0 0 110px;
    }

    .footer {
        display: block;
    }
}

@media (min-width: 1024px) {
    /* ==================== DESKTOP - увеличенные размеры ==================== */

    html {
        font-size: 18px;
    }

    .container {
        max-width: 900px;
        padding: 0 32px;
    }

    /* Header */
    .header {
        padding: 14px 0;
    }

    .header .container {
        padding: 0 40px;
        max-width: 1400px;
        margin: 0 auto;
    }

    .navbar {
        gap: 40px;
    }

    .navbar-brand .logo {
        font-size: 1.15rem;
        gap: 10px;
    }

    .navbar-menu {
        gap: 32px;
    }

    .navbar-menu a {
        font-size: 0.95rem;
    }

    .navbar-actions {
        gap: 16px;
    }

    .lang-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .user-info {
        gap: 12px;
        font-size: 0.9rem;
    }

    .user-name {
        max-width: 150px;
        font-size: 0.9rem;
    }

    .user-credits {
        padding: 8px 16px;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    .btn-text {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    /* Services Grid */
    .services-page {
        padding: 40px 20px;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1100px;
        gap: 24px;
        margin: 0 auto;
    }

    .service-card {
        padding: 32px;
    }

    .service-card .icon {
        font-size: 3rem;
        margin-bottom: 20px;
    }

    .service-card h3 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .service-card p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    .credits-info {
        margin-top: 20px;
        padding-top: 16px;
    }

    .credits-cost {
        font-size: 1rem;
    }

    /* Upload Page */
    .upload-page {
        padding: 40px 20px;
    }

    .upload-container {
        max-width: 700px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header p {
        font-size: 1.1rem;
    }

    .back-link {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .user-info-bar {
        font-size: 1rem;
        padding: 14px 20px;
        margin-bottom: 28px;
    }

    /* Upload Form */
    .upload-form {
        padding: 36px;
    }

    .upload-zone {
        padding: 48px 32px;
    }

    .upload-zone .icon {
        font-size: 4rem;
        margin-bottom: 20px;
    }

    .upload-zone h3 {
        font-size: 1.3rem;
    }

    .upload-zone p {
        font-size: 1rem;
    }

    /* Preview */
    .preview-image {
        max-height: 400px;
    }

    .remove-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }

    /* Buttons */
    .submit-btn {
        padding: 18px 28px;
        font-size: 1.15rem;
    }

    .credits-note {
        font-size: 0.95rem;
        margin-top: 16px;
    }

    /* Options */
    .option-card {
        padding: 20px;
    }

    .option-card h4 {
        font-size: 1.1rem;
    }

    .option-card p {
        font-size: 0.9rem;
    }

    /* Results */
    .result-section {
        padding: 36px;
    }

    .result-section h2 {
        font-size: 1.5rem;
    }

    .result-comparison {
        gap: 24px;
        margin-bottom: 24px;
    }

    .result-comparison .label {
        font-size: 1rem;
        margin-top: 12px;
    }

    .btn-download, .btn-new {
        padding: 14px 28px;
        font-size: 1rem;
    }

    /* Loading */
    .loading-spinner {
        width: 64px;
        height: 64px;
        border-width: 4px;
    }

    .loading-overlay h3 {
        font-size: 1.4rem;
    }

    .loading-overlay p {
        font-size: 1.1rem;
    }

    /* Auth Section */
    .auth-section {
        padding: 48px;
    }

    .auth-section h3 {
        font-size: 1.5rem;
    }

    .auth-section p {
        font-size: 1.1rem;
    }

    .btn-telegram {
        padding: 16px 32px;
        font-size: 1.1rem;
    }

    /* Dance Grid - larger for desktop */
    .dance-grid {
        gap: 12px;
    }

    .dance-card {
        border-radius: 12px;
    }

    .dance-card .dance-name {
        font-size: 0.75rem;
        padding: 16px 6px 8px;
    }

    /* History */
    .history-section h3 {
        font-size: 1.1rem;
    }

    .history-item {
        flex: 0 0 140px;
    }

    /* Error */
    .error-msg {
        padding: 16px;
        font-size: 1rem;
    }

    /* Footer */
    .footer {
        padding: 24px;
    }

    .footer a {
        font-size: 0.9rem;
    }

    /* User Welcome Badge */
    .user-welcome {
        font-size: 0.95rem;
        padding: 8px 16px;
        gap: 10px;
    }

    .credits-badge {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
}

/* ==================== LARGE DESKTOP (1440px+) ==================== */
@media (min-width: 1440px) {
    html {
        font-size: 20px;
    }

    /* Header - more spacious */
    .header .container {
        padding: 0 60px;
        max-width: 1600px;
    }

    .navbar {
        gap: 60px;
    }

    .navbar-brand .logo {
        font-size: 1.25rem;
    }

    .navbar-menu {
        gap: 40px;
    }

    .navbar-menu a {
        font-size: 1rem;
    }

    .navbar-actions {
        gap: 20px;
    }

    .user-info {
        gap: 14px;
    }

    .user-name {
        max-width: 180px;
        font-size: 0.95rem;
    }

    .user-credits {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .container {
        max-width: 1000px;
    }

    .services-grid {
        max-width: 1200px;
        gap: 28px;
    }

    .upload-container {
        max-width: 800px;
    }

    .service-card {
        padding: 36px;
    }

    .service-card .icon {
        font-size: 3.5rem;
    }

    .upload-form {
        padding: 44px;
    }

    /* Dance Grid - larger */
    .dance-grid {
        gap: 14px;
    }

    .dance-card .dance-name {
        font-size: 0.8rem;
    }
}
