/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--tg-theme-bg-color, #f0f2f5);
    color: var(--tg-theme-text-color, #1a1a2e);
    line-height: 1.5;
    padding-bottom: 20px;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ===== ONBOARDING ===== */
#onboarding {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--tg-theme-bg-color, #f0f2f5);
}

.onboarding-slides {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.onboarding-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.onboarding-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.onboarding-slide.exit-left {
    opacity: 0;
    transform: translateX(-60px);
}

.slide-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.slide-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--tg-theme-text-color, #1a1a2e);
    margin-bottom: 12px;
}

.slide-text {
    font-size: 15px;
    color: var(--tg-theme-hint-color, #8e8e93);
    line-height: 1.6;
    max-width: 320px;
    margin-bottom: 24px;
}

.slide-stats {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 340px;
}

.slide-stat {
    flex: 1;
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: 14px;
    padding: 16px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.slide-stat-value {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.slide-stat-label {
    display: block;
    font-size: 11px;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-top: 4px;
}

/* Кнопка с подсветкой */
.btn-glow {
    margin-top: 8px;
    padding: 16px;
    font-size: 16px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(36, 129, 204, 0.4);
}

.btn-glow:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(36, 129, 204, 0.3);
}

/* Футер онбординга */
.onboarding-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 32px;
}

.onboarding-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tg-theme-hint-color, #c4c4c4);
    opacity: 0.35;
    transition: all 0.3s ease;
}

.dot.active {
    opacity: 1;
    background: var(--tg-theme-button-color, #2481cc);
    width: 24px;
    border-radius: 4px;
}

.onboarding-next {
    border: none;
    background: none;
    color: var(--tg-theme-button-color, #2481cc);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 4px;
}

.onboarding-next:active {
    opacity: 0.7;
}

.onboarding-next.hidden {
    visibility: hidden;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px 12px;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--tg-theme-text-color, #1a1a2e);
}

.header-user {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #8e8e93);
}

.trial-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff3e0;
    color: #e65100;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.trial-icon {
    font-size: 14px;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--tg-theme-secondary-bg-color, #e8eaed);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 10px 6px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #8e8e93);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab.active {
    background: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
    box-shadow: 0 2px 8px rgba(36, 129, 204, 0.3);
}

/* ===== PAGES ===== */
.page {
    display: none;
}

.page.active {
    display: block;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    padding-left: 4px;
    color: var(--tg-theme-text-color, #1a1a2e);
}

/* ===== CARDS ===== */
.card {
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--tg-theme-text-color, #1a1a2e);
}

/* ===== STRATEGY CARDS ===== */
.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.strategy-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--tg-theme-text-color, #1a1a2e);
}

.strategy-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-top: 2px;
}

.strategy-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-locked {
    background: #fce4ec;
    color: #c62828;
}

.strategy-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.stat-item {
    flex: 1;
    text-align: center;
    background: var(--tg-theme-bg-color, #f0f2f5);
    border-radius: 10px;
    padding: 10px 6px;
}

.stat-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-top: 2px;
}

.profit-positive {
    color: #2e7d32;
}

.profit-negative {
    color: #c62828;
}

.strategy-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--tg-theme-bg-color, #f0f2f5);
}

.strategy-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tg-theme-text-color, #1a1a2e);
}

/* ===== BUTTONS ===== */
.btn {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--tg-theme-button-color, #2481cc);
    color: var(--tg-theme-button-text-color, #ffffff);
}

.btn-primary:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    color: var(--tg-theme-button-color, #2481cc);
    border: 1.5px solid var(--tg-theme-button-color, #2481cc);
}

.btn-outline:active {
    background: rgba(36, 129, 204, 0.08);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

/* ===== FILTERS ===== */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.select-filter {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--tg-theme-bg-color, #e0e0e0);
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #1a1a2e);
    font-size: 13px;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8e93' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

/* ===== DATE NAV ===== */
.date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.date-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--tg-theme-secondary-bg-color, #ffffff);
    color: var(--tg-theme-text-color, #1a1a2e);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.date-btn:active {
    transform: scale(0.94);
}

.date-current {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color, #1a1a2e);
}

/* ===== MATCH CARDS ===== */
.match-card {
    position: relative;
    overflow: hidden;
}

.match-result-win {
    border-left: 3px solid #2e7d32;
}

.match-result-lose {
    border-left: 3px solid #c62828;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--tg-theme-hint-color, #8e8e93);
    font-size: 15px;
}

.match-league {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.league-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--tg-theme-button-color, #2481cc);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.team {
    flex: 1;
    text-align: center;
}

.team-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--tg-theme-text-color, #1a1a2e);
}

.match-vs {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #8e8e93);
}

.match-bet {
    display: flex;
    gap: 8px;
    background: var(--tg-theme-bg-color, #f0f2f5);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
}

.bet-info {
    flex: 1;
    text-align: center;
}

.bet-label {
    display: block;
    font-size: 11px;
    color: var(--tg-theme-hint-color, #8e8e93);
}

.bet-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-top: 2px;
}

.result-win {
    color: #2e7d32;
}

.result-lose {
    color: #c62828;
}

.match-strategy-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--tg-theme-button-color, #2481cc);
    background: rgba(36, 129, 204, 0.1);
    padding: 3px 10px;
    border-radius: 8px;
}

.match-type-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 4px;
    vertical-align: middle;
}

.match-type-live {
    color: #fff;
    background: #e53935;
}

.match-type-prematch {
    color: #fff;
    background: #43a047;
}

/* ===== STATS ===== */
.stats-summary {
    background: linear-gradient(135deg, #2481cc 0%, #1a6bb5 100%);
    color: #ffffff;
}

.summary-row {
    display: flex;
    gap: 12px;
}

.summary-row + .summary-row {
    margin-top: 12px;
}

.summary-item {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px 8px;
}

.stats-summary .summary-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.stats-summary .profit-positive {
    color: #a5d6a7;
}

.summary-label {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

/* ===== STATS TABLE ===== */
.stats-table {
    overflow-x: auto;
}

.table-header,
.table-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.table-header {
    border-bottom: 2px solid var(--tg-theme-bg-color, #f0f2f5);
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #8e8e93);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table-row {
    border-bottom: 1px solid var(--tg-theme-bg-color, #f0f2f5);
}

.table-row:last-child {
    border-bottom: none;
}

.col-name {
    flex: 2;
    font-weight: 600;
    font-size: 13px;
}

.col-profit,
.col-roi,
.col-bets {
    flex: 1;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
}

/* ===== WINRATE BARS ===== */
.winrate-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.winrate-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.winrate-bar {
    height: 8px;
    background: var(--tg-theme-bg-color, #f0f2f5);
    border-radius: 4px;
    overflow: hidden;
}

.winrate-fill {
    height: 100%;
    background: linear-gradient(90deg, #2481cc, #43a047);
    border-radius: 4px;
    transition: width 0.8s ease;
}

.winrate-fill-bad {
    background: linear-gradient(90deg, #ef5350, #e53935);
}

/* ===== PROFILE ===== */
.profile-card {
    text-align: center;
    padding: 24px 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2481cc, #1a6bb5);
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
}

.profile-username {
    font-size: 14px;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-top: 2px;
}

/* ===== SUBSCRIPTIONS ===== */
.subscription-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--tg-theme-bg-color, #f0f2f5);
}

.subscription-item:last-child {
    border-bottom: none;
}

.sub-name {
    font-size: 15px;
    font-weight: 600;
    display: block;
}

.sub-status {
    font-size: 12px;
    margin-top: 2px;
    display: block;
}

.sub-active {
    color: #2e7d32;
}

.sub-trial {
    color: #e65100;
}

.sub-expired {
    color: #c62828;
}

/* ===== PRICING ===== */
.pricing-item {
    padding: 16px;
    border-radius: 12px;
    border: 1.5px solid var(--tg-theme-bg-color, #e0e0e0);
    margin-bottom: 10px;
    position: relative;
}

.pricing-popular {
    border-color: var(--tg-theme-button-color, #2481cc);
    background: rgba(36, 129, 204, 0.04);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--tg-theme-button-color, #2481cc);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 8px;
}

.pricing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricing-name {
    font-size: 15px;
    font-weight: 700;
}

.pricing-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--tg-theme-button-color, #2481cc);
}

.pricing-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-top: 4px;
}

/* ===== ANIMATIONS ===== */
.card {
    animation: fadeUp 0.3s ease;
}

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

/* ===== ADMIN FORM ===== */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.form-row-half {
    display: flex;
    gap: 10px;
}

.form-row-half > .form-row {
    flex: 1;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-hint-color, #8e8e93);
    margin-bottom: 4px;
}

.form-input {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--tg-theme-bg-color, #e0e0e0);
    background: var(--tg-theme-bg-color, #f0f2f5);
    color: var(--tg-theme-text-color, #1a1a2e);
    font-size: 14px;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color, #2481cc);
}

.admin-bet-row {
    padding: 12px 16px;
}

.btn-danger {
    background: #c62828;
    color: #ffffff;
}

.btn-danger:active {
    opacity: 0.8;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}
