@import url('https://fonts.googleapis.com/css2?family=Satoshi:wght@400;700&family=Jost:wght@400;500&display=swap');
@import 'animations.css';
@import 'language-switcher.css';

/* Link styles for light/dark theme */
a, a:visited {
    color: var(--tg-link);
    text-decoration: underline;
    transition: color 0.2s;
    word-break: break-all;
}
a:hover, a:active {
    color: var(--tg-blue-dark);
    text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
    a, a:visited {
        color: var(--tg-link);
        text-decoration: underline;
    }
    a:hover, a:active {
        color: var(--tg-blue);
    }
}

/* Deck page cards */
.deck-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
    width: 100%;
}
.deck-card {
    background: var(--card-bg);
    border: 1px solid rgba(34,158,217,0.18);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color-light);
    padding: 20px 18px 16px 18px;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.deck-card-title,
.deck-card h2 {
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--tg-text);
}
.deck-card-text {
    font-size: 1em;
    color: var(--tg-hint);
    line-height: 1.5;
}
.deck-testimonials {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.deck-testimonial {
    background: var(--card-bg);
    border-left: 4px solid var(--tg-blue);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1em;
    color: var(--tg-text);
    font-style: italic;
    line-height: 1.5;
    box-shadow: 0 1px 4px var(--shadow-color-light);
}
.team-section {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 32px !important;
}
.deck-sim-block {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color-light);
    padding: 24px 18px 18px 18px;
    margin-bottom: 32px;
}
.summary-section {
    background: var(--card-bg) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px var(--shadow-color-light) !important;
    padding: 24px 18px 18px 18px !important;
    margin-bottom: 32px !important;
}
@media (max-width: 700px) {
    body, #app {
        padding-left: 12px;
        padding-right: 12px;
        box-sizing: border-box;
    }
    .deck-cards {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .deck-card {
        max-width: 100%;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
    .deck-sim-block, .summary-section {
        padding: 16px 6px 12px 6px;
    }
}

:root {
    /* Telegram default colors (light mode) */
    --tg-blue: #229ED9;
    --tg-blue-dark: #0088cc;
    --tg-bg: #ffffff;
    --tg-bg-dark: #181a20;
    --tg-text: #222222;
    --tg-text-dark: #ffffff;
    --tg-hint: #8e8e93;
    --tg-hint-dark: #a0a0a0;
    --tg-link: #229ED9;
    --tg-link-dark: #6ab3f3;
    --tg-button: #229ED9;
    --tg-button-dark: #0088cc;
    --tg-button-text: #ffffff;
    --tg-button-text-dark: #ffffff;

    /* Brand/Accent colors (fallbacks) */
    --brand-purple: #8F7EFC;
    --accent-purple: #8F7EFC;
    --accent-pink: #B57EFC;
    --accent-red: #FC7E9C;

    /* Card and overlay */
    --card-bg: #f7f7f7;
    --card-bg-dark: #23272f;
    --overlay-color: rgba(0, 0, 0, 0.7);
    --overlay-color-light: rgba(255, 255, 255, 0.7);

    /* Badge color */
    --badge-color: #FFD700;

    /* Shadows */
    --shadow-color: rgba(34, 158, 217, 0.2);
    --shadow-color-light: rgba(34, 158, 217, 0.1);

    /* Text shadow */
    --text-shadow: none;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --tg-bg: var(--tg-bg-dark);
        --tg-text: var(--tg-text-dark);
        --tg-hint: var(--tg-hint-dark);
        --tg-link: var(--tg-link-dark);
        --tg-button: var(--tg-button-dark);
        --tg-button-text: var(--tg-button-text-dark);
        --card-bg: var(--card-bg-dark);
        --overlay-color: var(--overlay-color);
        --text-shadow: none;
        --shadow-color: rgba(0, 136, 204, 0.2);
        --shadow-color-light: rgba(0, 136, 204, 0.1);
    }
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
    :root {
        --tg-bg: #ffffff;
        --tg-text: #222222;
        --tg-hint: #8e8e93;
        --tg-link: #229ED9;
        --tg-button: #229ED9;
        --tg-button-text: #ffffff;
        --card-bg: #f7f7f7;
        --overlay-color: var(--overlay-color-light);
        --text-shadow: none;
        --shadow-color: rgba(34, 158, 217, 0.2);
        --shadow-color-light: rgba(34, 158, 217, 0.1);
    }
}

.logo {
    display: block;
    width: 200px;
    margin: 20px auto;
    height: auto;
}

/* Rest of the existing styles... */

.loading-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 4px;
    width: 100%;
}

.loading-row .assistant-card {
    margin: 0 auto;
    width: 280px;
    height: 400px;
}

/* Keep all existing styles below... */
html, body {
    margin: 0;
    padding: 0;
    background: var(--tg-bg);
    color: var(--tg-text);
    font-family: 'Jost', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    touch-action: none;
}

/* Desktop container wrapper for centering */
@media (min-width: 600px) {
    body {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        background: var(--tg-bg);
    }
}

#app.with-navbar {
    padding-top: 0;
}
#app.no-navbar {
    padding-top: 0;
}
#app {
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 2;
    color: var(--tg-text);
}

/* Desktop width limitation */
@media (min-width: 600px) {
    #app {
        max-width: 480px;
        width: 480px;
        margin: 0 auto;
    }
}

/* Logo header background */
.logo-header {
    flex: 0 0 60px;
    width: 100%;
    height: 60px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 300;
    position: relative;
}

.logo-header img {
    height: 40px;
    max-width: 150px;
    padding-left: 15px;
    width: auto;
}

/* Small button component - reusable */
.button-small {
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--tg-button), var(--tg-button-dark));
    color: var(--tg-button-text);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow-color-light);
}

.button-small:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.button-small:active {
    transform: scale(0.98);
}

/* Donate button specific positioning */
.donate-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.donate-button:hover {
    transform: translateY(-50%) scale(1.02);
}

.donate-button:active {
    transform: translateY(-50%) scale(0.98);
}

.categories-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 0 16px 24px;
    min-height: 100%;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.category-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-header {
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-text);
    padding: 0 8px;
    text-shadow: none;
}

.assistants-scroll {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 12px 4px;
}

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

.assistants-row {
    display: flex;
    gap: 20px;
}

.assistant-detail {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.detail-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: visible;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
    z-index: 10;
    position: relative;
    overflow-x: visible; /* Allow tinder gallery to overflow horizontally */
}

/* Ensure all content containers have proper z-index */
.categories-container, 
.detail-container, 
.assistant-detail {
    position: relative;
    z-index: 10;
    overflow-x: visible; /* Allow tinder gallery to overflow horizontally */
}

.detail-content {
    padding: 32px;
    position: relative;
}

.detail-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--tg-text);
    text-shadow: var(--text-shadow);
}

.detail-content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--tg-hint);
    margin: 0;
}

.detail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(143, 126, 252, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 10;
}

/* Desktop width limitation for detail footer */
@media (min-width: 600px) {
    .detail-footer {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.finish-chat-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(252, 126, 156, 0.2);
}

.footer-stat {
    font-size: 14px;
    color: var(--tg-hint);
}

/* Floating close button - unified style */
.floating-close-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--tg-button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: normal;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Desktop positioning for floating close button */
@media (min-width: 600px) {
    .floating-close-button {
        right: calc(50% - 240px + 20px);
    }
}

.floating-close-button:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.8);
}

/* Special styling for close button in header context (donate page) */
.floating-close-button:not([id]) {
    position: static;
    background: var(--shadow-color-light);
    color: var(--tg-text);
    border: 1px solid var(--shadow-color-light);
    backdrop-filter: none;
}

.floating-close-button:not([id]):active {
    background: var(--shadow-color);
    color: var(--tg-text);
}

/* Keep floating-back-button as alias for backward compatibility */
.floating-back-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: var(--tg-button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.floating-back-button:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.8);
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--tg-text);
    animation: spin 1s linear infinite;
}

.status-message {
    background: rgba(37, 37, 37, 0.8);
    backdrop-filter: blur(10px);
    color: var(--tg-text);
    padding: 16px;
    border-radius: 2px;
    margin: 12px 0;
    font-size: 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #F9F9F9;
}


.error-message {
    background: rgba(252, 126, 156, 0.1);
    color: var(--accent-red);
    border-color: rgba(252, 126, 156, 0.3);
}

.chat-item {
    border-bottom: 1px solid rgba(143, 126, 252, 0.1);
    padding: 16px 24px;
    margin: 8px 0;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(37, 37, 37, 0.6);
}

.chat-item.clickable {
    cursor: pointer;
    position: relative;
}

.chat-item.clickable:hover {
    background: rgba(143, 126, 252, 0.1);
}

.chat-item.clickable::after {
    content: '';
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(143, 126, 252, 0.5);
    border-right: 2px solid rgba(143, 126, 252, 0.5);
    transform: rotate(45deg);
    position: absolute;
    right: 16px;
    top: 50%;
    margin-top: -4px;
}

.chat-item:active {
    transform: scale(0.99);
}

.chat-item:last-child {
    border-bottom: none;
    margin-bottom: 76px;
}

.promo-message {
    background: linear-gradient(135deg, rgba(143, 126, 252, 0.1), rgba(181, 126, 252, 0.1));
    padding: 24px;
    border-radius: 2px;
    margin: 0 16px 32px;
    text-align: center;
    border: 1px solid #F9F9F9;
    backdrop-filter: blur(10px);
}

.promo-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--tg-text);
    text-shadow: var(--text-shadow);
}

.promo-subtitle {
    font-size: 16px;
    color: var(--tg-hint);
    margin-bottom: 16px;
}

.promo-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: var(--tg-button-text);
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s;
}

.promo-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px var(--shadow-color-light);
}

@keyframes glow {
    0% { box-shadow: 0 0 5px var(--shadow-color-light); }
    50% { box-shadow: 0 0 20px var(--shadow-color); }
    100% { box-shadow: 0 0 5px var(--shadow-color-light); }
}


.floating-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-link));
    color: var(--tg-button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s ease, background-image 0.3s ease;
    z-index: 1000;
    animation: glow 2s infinite;
    border: 2px solid rgba(34, 158, 217, 0.18);
    background-size: cover;
    background-position: center;
}

/* Desktop positioning for floating chat button */
@media (min-width: 600px) {
    .floating-chat-button {
        right: calc(50% - 240px + 30px);
    }
}

.floating-chat-button svg {
    position: relative;
    z-index: 2;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.5));
}

.floating-chat-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 30px var(--shadow-color);
}

.floating-chat-button.in-transition {
    animation: chatButtonTransition 0.5s ease;
}

@keyframes chatButtonTransition {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-5deg); }
    50% { transform: scale(0.95) rotate(5deg); }
    75% { transform: scale(1.02) rotate(-3deg); }
    100% { transform: scale(1) rotate(0deg); }
}


/* Fullscreen gallery */
.fullscreen-gallery {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--tg-text);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    z-index: 1001;
}

.fullscreen-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tg-bg);
    color: var(--tg-text);
    padding: 8px 16px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1001;
}

/* Assistant Tinder styles */
.assistant-tinder {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}


/* Sponsors section styles */
.sponsors-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--shadow-color-light);
}

.sponsors-section h3 {
    font-family: 'Satoshi', Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--tg-text);
    text-align: center;
}

.sponsors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    align-items: center;
    justify-items: center;
}

.sponsor-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--shadow-color-light);
    transition: all 0.3s ease;
    width: 100%;
    max-width: 140px;
    height: 80px;
}

.sponsor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color-light);
    border-color: var(--tg-blue);
}

.sponsor-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(20%) opacity(0.8);
    transition: filter 0.3s ease;
}

.sponsor-item:hover .sponsor-logo {
    filter: grayscale(0%) opacity(1);
}

@media (max-width: 600px) {
    .sponsors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .sponsor-item {
        height: 70px;
        padding: 12px;
    }
}

/* Universal Main Button styles for web environment */
.universal-main-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 48px;
    background: var(--tg-button);
    color: var(--tg-button-text);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Desktop width limitation for universal main button */
@media (min-width: 600px) {
    .universal-main-button {
        max-width: 440px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

.universal-main-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
    background: var(--tg-button-dark);
}

.universal-main-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Desktop hover/active states with proper transform */
@media (min-width: 600px) {
    .universal-main-button:hover {
        transform: translateX(-50%) translateY(-1px);
    }
    
    .universal-main-button:active {
        transform: translateX(-50%) translateY(0);
    }
}

.universal-main-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.universal-main-button:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px var(--shadow-color);
    background: var(--tg-button);
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    .universal-main-button {
        left: 16px;
        right: 16px;
        bottom: 16px;
        height: 52px;
        font-size: 17px;
        border-radius: 14px;
    }
}
