/**
 * SotkaDashboardMobile.css
 * Стили для мобильного дашборда Sotka — панель администрирования Telegram-каналов
 *
 * Dark Premium: Background #1D2232, Gold #756346
 * ABSOLUTE POSITIONING для всех элементов
 */

/* ==================== КОНТЕЙНЕР ==================== */
.sotka-dashboard {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1D2232;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #AEAFB0;
    -webkit-overflow-scrolling: touch;
}

.sotka-dashboard-inner {
    position: relative;
    width: 100%;
    max-width: 390px;
    min-height: 100%;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* ==================== HEADER ==================== */
.dashboard-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #1D2232;
    z-index: 10;
}

.header-avatar {
    position: absolute;
    top: 14px;
    left: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #756346, #9a8462);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.header-greeting {
    position: absolute;
    top: 12px;
    left: 58px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748B;
    font-weight: 600;
}

.header-username {
    position: absolute;
    top: 27px;
    left: 58px;
    font-size: 16px;
    font-weight: 700;
    color: #AEAFB0;
}

.header-notification {
    position: absolute;
    top: 16px;
    right: 56px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-notification svg {
    width: 14px;
    height: 14px;
    fill: #64748B;
}

.header-settings {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-settings svg {
    width: 14px;
    height: 14px;
    fill: #64748B;
}

/* ==================== CHANNEL SUMMARY ==================== */
.channel-summary {
    position: absolute;
    top: 68px;
    left: 16px;
    right: 16px;
    height: 44px;
    background: linear-gradient(135deg, rgba(117, 99, 70, 0.15), rgba(117, 99, 70, 0.05));
    border: 1px solid rgba(117, 99, 70, 0.25);
    border-radius: 12px;
}

.channel-summary-label {
    position: absolute;
    top: 6px;
    left: 14px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #756346;
    font-weight: 600;
}

.channel-summary-name {
    position: absolute;
    top: 22px;
    left: 14px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.channel-summary-subs {
    position: absolute;
    top: 24px;
    right: 14px;
    font-size: 11px;
    font-weight: 600;
    color: #AFD15C;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    position: absolute;
    top: 120px;
    left: 16px;
    right: 16px;
    height: 170px;
}

.stat-card {
    position: absolute;
    width: calc(50% - 6px);
    height: 78px;
    background: #242A38;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-card:nth-child(1) { top: 0; left: 0; }
.stat-card:nth-child(2) { top: 0; right: 0; left: auto; }
.stat-card:nth-child(3) { top: 86px; left: 0; }
.stat-card:nth-child(4) { top: 86px; right: 0; left: auto; }

.stat-icon {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 15px;
    height: 15px;
}

.stat-icon.reach { background: rgba(117, 99, 70, 0.15); }
.stat-icon.reach svg { fill: #756346; }

.stat-icon.subs { background: rgba(175, 209, 92, 0.12); }
.stat-icon.subs svg { fill: #AFD15C; }

.stat-icon.engagement { background: rgba(251, 191, 36, 0.12); }
.stat-icon.engagement svg { fill: #FBBF24; }

.stat-icon.ads { background: rgba(96, 165, 250, 0.12); }
.stat-icon.ads svg { fill: #60A5FA; }

.stat-value {
    position: absolute;
    top: 16px;
    right: 14px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    position: absolute;
    bottom: 12px;
    left: 14px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748B;
    font-weight: 600;
}

/* ==================== ACTIVITY CHART ==================== */
.chart-section {
    position: absolute;
    top: 300px;
    left: 16px;
    right: 16px;
    height: 200px;
    background: #242A38;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-title {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #AEAFB0;
}

.chart-period {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 10px;
    color: #756346;
    font-weight: 600;
    background: rgba(117, 99, 70, 0.12);
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}

.chart-canvas-wrap {
    position: absolute;
    top: 42px;
    left: 12px;
    right: 12px;
    bottom: 12px;
}

.chart-canvas-wrap canvas {
    width: 100%;
    height: 100%;
}

/* ==================== QUICK ACTIONS ==================== */
.quick-actions {
    position: absolute;
    top: 514px;
    left: 16px;
    right: 16px;
    height: 52px;
}

.quick-actions-title {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 13px;
    font-weight: 700;
    color: #AEAFB0;
}

.quick-action-btn {
    position: absolute;
    top: 24px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #242A38;
    color: #AEAFB0;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0 12px;
    white-space: nowrap;
}

.quick-action-btn:nth-child(2) { left: 0; }
.quick-action-btn:nth-child(3) { left: 34%; }
.quick-action-btn:nth-child(4) { left: 68%; }

.quick-action-btn:active {
    background: rgba(117, 99, 70, 0.2);
    border-color: rgba(117, 99, 70, 0.4);
}

/* ==================== RECENT ACTIVITY ==================== */
.recent-activity {
    position: absolute;
    top: 580px;
    left: 16px;
    right: 16px;
    height: 180px;
}

.recent-title {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 13px;
    font-weight: 700;
    color: #AEAFB0;
}

.activity-item {
    position: absolute;
    left: 0;
    right: 0;
    height: 48px;
    background: #242A38;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.activity-item:nth-child(2) { top: 26px; }
.activity-item:nth-child(3) { top: 80px; }
.activity-item:nth-child(4) { top: 134px; }

.activity-dot {
    position: absolute;
    top: 18px;
    left: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.activity-dot.green { background: #AFD15C; }
.activity-dot.red { background: #FE523D; }
.activity-dot.blue { background: #60A5FA; }

.activity-text {
    position: absolute;
    top: 10px;
    left: 34px;
    font-size: 12px;
    font-weight: 600;
    color: #AEAFB0;
}

.activity-time {
    position: absolute;
    top: 28px;
    left: 34px;
    font-size: 10px;
    color: #64748B;
}

.activity-amount {
    position: absolute;
    top: 16px;
    right: 14px;
    font-size: 12px;
    font-weight: 700;
}

.activity-amount.positive { color: #AFD15C; }
.activity-amount.negative { color: #FE523D; }

/* ==================== FOOTER — CURVED TAB BAR ==================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 100;
}

.tab-bar-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
}

.tab-bar-bg svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
}

/* Tab items — absolute positioning */
.tab-bar-item {
    position: absolute;
    bottom: 14px;
    width: 56px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tab-bar-item:nth-child(2) { left: calc(10% - 28px); }
.tab-bar-item:nth-child(3) { left: calc(28% - 28px); }
.tab-bar-item:nth-child(5) { left: calc(72% - 28px); }
.tab-bar-item:nth-child(6) { left: calc(90% - 28px); }

.tab-bar-item svg {
    width: 20px;
    height: 20px;
    fill: #64748B;
    margin-bottom: 2px;
}

.tab-bar-item.active svg {
    fill: #756346;
}

.tab-bar-item-label {
    font-size: 8px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tab-bar-item.active .tab-bar-item-label {
    color: #756346;
}

.tab-bar-item:active svg {
    fill: #9c845f;
}

.tab-bar-item:active .tab-bar-item-label {
    color: #9c845f;
}

/* Action Hub — центральная кнопка в вырезе */
#action-hub-btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    border: 4px solid #1D2232;
    box-shadow:
        0 8px 28px rgba(59, 130, 246, 0.45),
        0 0 18px rgba(59, 130, 246, 0.35),
        0 0 42px rgba(37, 99, 235, 0.22);
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

#action-hub-btn svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

#action-hub-btn:active {
    transform: translateX(-50%) scale(0.92);
    box-shadow:
        0 4px 14px rgba(59, 130, 246, 0.55),
        0 0 24px rgba(37, 99, 235, 0.32);
}

@media (max-width: 390px) {
    .quick-actions {
        left: 12px;
        right: 12px;
    }

    .quick-action-btn {
        font-size: 10px;
        padding: 0 8px;
    }

    .quick-action-btn:nth-child(2) { left: 0; width: 31%; }
    .quick-action-btn:nth-child(3) { left: 34.5%; width: 31%; }
    .quick-action-btn:nth-child(4) { left: 69%; width: 31%; }

    .tab-bar-item:nth-child(2) { left: calc(9% - 28px); }
    .tab-bar-item:nth-child(3) { left: calc(27% - 28px); }
    .tab-bar-item:nth-child(5) { left: calc(73% - 28px); }
    .tab-bar-item:nth-child(6) { left: calc(91% - 28px); }

    .tab-bar-item-label {
        font-size: 7px;
        letter-spacing: 0.2px;
    }
}

/* ==================== SCROLLBAR ==================== */
.sotka-dashboard::-webkit-scrollbar {
    width: 0;
}
