/* TalkToAi.me MiniApp */
:root {
    --bg-color: #1a021b;
    /* Deep night purple */
    --secondary-bg: rgba(69, 9, 83, 0.4);
    --text-color: #f8fafc;
    --hint-color: rgba(248, 250, 252, 0.6);
    --link-color: #cc23b0;
    --button-color: #cc23b0;
    --button-text: #ffffff;
    --accent: #cc23b0;
    --accent-gradient: linear-gradient(135deg, #cc23b0 0%, #7b0a69 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(204, 35, 176, 0.3);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(204, 35, 176, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(123, 10, 105, 0.15) 0%, transparent 40%);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* App Container */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    min-width: 320px;
    margin: 0 auto;
    position: relative;
    overflow-x: hidden;
}

/* Glass Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(28, 1, 18, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    font-size: 1.5rem;
    color: #800a37;
    font-weight: bold;
    text-decoration: none;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.5rem;
}

/* Main Content Area */
.main {
    flex: 1;
    padding: 20px;
    padding-bottom: 100px;
    background: transparent;
}

.character-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
    padding-bottom: 15px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.6s ease-out backwards;
}

.character-card:active {
    transform: scale(0.95);
}

.card-image-wrapper {
    display: block;
    width: 100%;
    height: 200px;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.character-avatar {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.character-avatar-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.character-card-info {
    padding: 12px;
    text-align: center;
}

.character-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-description {
    font-size: 0.8rem;
    color: var(--hint-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.character-detail {
    padding: 15px;
    text-align: center;
    margin: 0 auto;
}

/* Character Detail View */
.character-detail-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 15px;
    text-align: center;
}

.character-detail-hero img {
    max-width: 100%;
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, var(--bg-color));
}

.hero-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-section {
    margin-top: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.info-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hint-color);
    margin-bottom: 12px;
}

.info-section p {
    font-size: 1rem;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 0 20px rgba(204, 35, 176, 0.3);
}

.character-card .btn {
    position: relative;
    z-index: 2;
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(204, 35, 176, 0.2);
}

.btn-full {
    width: 100%;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    justify-content: space-around;
    background: rgba(26, 2, 27, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px 12px;
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--hint-color);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.2s;
    flex: 1;
}

.nav-item.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.nav-item.active .nav-icon {
    animation: iconPulse 2s infinite ease-in-out;
    filter: drop-shadow(0 0 8px var(--accent));
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Loading States */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Profile Card */
.profile-card {
    background: linear-gradient(135deg, #950d40 0%, #420e66 100%);
    padding: 15px;
    border-radius: var(--radius-lg);
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 16px;
    backdrop-filter: blur(4px);
}

.stats-container {
    display: flex;
    gap: 12px;
}

.stat-item {
    flex: 1;
    background: var(--secondary-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--glass-border);
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--hint-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Badges & Subscription Cards */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent-gradient);
    color: white;
}

.sub-card-basic {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.sub-card-premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 143, 0, 0.1) 100%);
    border: 1px solid #ff8f00;
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 143, 0, 0.2);
}

/* Secondary Button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-secondary:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Chats List */
.chats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--accent-gradient);
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-action-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: var(--accent-gradient);
}

/* Fix for footer spacing */
.footer-padding {
    height: 100px;
}

.icon-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}


.diamond-packages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.package-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
}

.package-card:active {
    transform: scale(0.98);
}

.package-card.popular {
    border: 1px solid #ff8f00;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, var(--secondary-bg) 100%);
}

.popular-label {
    position: absolute;
    top: -10px;
    left: 20px;
    background: #ffd700;
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.package-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.package-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: #cbae07;
    display: flex;
    align-items: center;
    gap: 6px;
}

.package-save-tag {
    background: #4caf50;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    width: fit-content;
}

.package-price-btn {
    background: #1a73e8;
    color: white;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}

.package-card.popular .package-price-btn {
    background: #ffd700;
    color: #000;
}

.transaction-item {
    background: var(--secondary-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (min-width: 990px) {
    .app {
        max-width: 992px;
    }

    .card-image-wrapper {
        max-height: 250px;
    }
}

/* Web-only SEO elements (hidden in Telegram App) */
.is-telegram .web-only {
    display: none !important;
}

.seo-footer {
    background: rgba(26, 2, 27, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 40px 20px 30px;
    margin-top: 40px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 10;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-brand {
    max-width: 400px;
}

.footer-logo-link {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 12px;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--hint-color);
    line-height: 1.6;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.footer-links-col h4 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 15px;
    font-weight: 700;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.75;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-link:hover {
    opacity: 1;
    color: var(--accent);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--hint-color);
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: rgba(248, 250, 252, 0.4);
    max-width: 600px;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .footer-links-grid {
        grid-template-columns: repeat(2, 160px);
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}