/* ===========================
   BASE — Cat Theme 🐾
   Warm, cozy palette inspired by Lua, Snow & Mia
   ========================= */

:root {
    /* ===== Cat Color Palette ===== */
    --bg-primary: #fef6eb;
    /* warm cream */
    --bg-secondary: #fff8f0;
    /* lighter cream */
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.85);

    --text-primary: #3d2c1e;
    /* warm dark brown */
    --text-secondary: #8b6f5e;
    /* soft brown */
    --text-muted: #bfa898;
    /* pale brown */

    /* Cat-specific colors */
    --lua-color: #7ab8bf;
    /* Lua — cool grey-blue */
    --lua-bg: #e8f4f6;
    --snow-color: #c4a4d4;
    /* Snow — soft lavender */
    --snow-bg: #f3eaf8;
    --mia-color: #f0a54a;
    /* Mia — warm golden */
    --mia-bg: #fef3e0;
    --all-color: #e8837c;
    /* Todos — rose */
    --all-bg: #fde8e6;

    /* Accent */
    --accent: #e8837c;
    /* soft rose */
    --accent-light: #fde8e6;
    --accent-dark: #d4635c;

    /* Paw & status */
    --paw-color: #d4a76a;
    --payment-pending: #f0a54a;
    --payment-paid: #6ec87a;
    --payment-overdue: #e8635c;

    /* UI basics */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xl: 24px;
    --shadow-soft: 0 2px 16px rgba(61, 44, 30, 0.06);
    --shadow-card: 0 4px 20px rgba(61, 44, 30, 0.08);
    --shadow-float: 0 8px 32px rgba(61, 44, 30, 0.12);

    /* Telegram variable fallbacks */
    --tg-theme-bg-color: var(--bg-primary);
    --tg-theme-text-color: var(--text-primary);
    --tg-theme-secondary-text-color: var(--text-secondary);

    /* Fonts */
    --font-body: 'Nunito', -apple-system, sans-serif;
    --font-heading: 'Fredoka', 'Nunito', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(122, 184, 191, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(240, 165, 74, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(196, 164, 212, 0.06) 0%, transparent 50%);
}

.hidden {
    display: none !important;
}

/* ===== HEADER ===== */
.app-header {
    position: relative;
    overflow: hidden;
}

.header-banner {
    position: relative;
    height: 120px;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(254, 246, 235, 0.95));
}

.app-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* ===== CAT AVATAR BAR ===== */
.cats-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 8px 16px 12px;
    background: var(--bg-secondary);
}

.cat-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cat-avatar:active {
    transform: scale(0.9);
}

.cat-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid transparent;
    object-fit: cover;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.cat-avatar[data-cat="lua"] img {
    border-color: var(--lua-color);
}

.cat-avatar[data-cat="snow"] img {
    border-color: var(--snow-color);
}

.cat-avatar[data-cat="mia"] img {
    border-color: var(--mia-color);
}

.cat-avatar:hover img,
.cat-avatar.active img {
    box-shadow: 0 0 0 3px rgba(232, 131, 124, 0.3);
}

.cat-name {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(61, 44, 30, 0.06);
}

.tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: var(--shadow-soft);
}

/* ===== VIEWS ===== */
.view {
    display: none;
    padding: 12px 12px 100px;
}

.view.active {
    display: block;
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: var(--shadow-float);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:active {
    transform: scale(0.92);
}

.fab.pulse {
    animation: fab-pulse 2s ease-in-out infinite;
}

@keyframes fab-pulse {

    0%,
    100% {
        box-shadow: var(--shadow-float);
    }

    50% {
        box-shadow: 0 8px 32px rgba(232, 131, 124, 0.4), 0 0 0 8px rgba(232, 131, 124, 0.15);
    }
}

.fab-paw {
    font-size: 1.5rem;
    line-height: 1;
}

/* ===== CONFETTI ===== */
.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
}

.empty-payments {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.empty-cat {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-sub {
    font-size: 0.85rem;
    margin-top: 4px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--paw-color);
    border-radius: 4px;
}