/* ============================================
   Clube Ômega — Custom Styles
   ============================================ */

/* ── Base ── */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overscroll-behavior-y: contain;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

/* ── Page transitions ── */
.page-enter {
    animation: slideIn 0.25s ease-out;
}

.page-exit {
    animation: slideOut 0.2s ease-in;
}

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

/* ── Cards ── */
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.card-gold {
    background: linear-gradient(135deg, #1e293b 0%, #1a1f2e 100%);
    border-color: rgba(251, 191, 36, 0.15);
}

/* ── Balance card ── */
.balance-card {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-radius: 20px;
    padding: 24px;
    color: #0f172a;
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

/* ── Bottom Navigation ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #1e293b;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 50;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0;
    color: #64748b;
    transition: color 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-item.active {
    color: #fbbf24;
}

.nav-item:hover {
    color: #94a3b8;
}

.nav-item.active:hover {
    color: #fbbf24;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Checkbox toggle for ranking ── */
.ranking-check {
    appearance: none;
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border: 2px solid #475569;
    border-radius: 8px;
    background: #1e293b;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.ranking-check:checked {
    background: #fbbf24;
    border-color: #fbbf24;
}

.ranking-check:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #0f172a;
    font-size: 16px;
    font-weight: bold;
}

.ranking-check:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Pulse animation for live indicator ── */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-gold {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.badge-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* ── Extrato list ── */
.extrato-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #1e293b;
}

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

.extrato-valor.positivo {
    color: #4ade80;
}

.extrato-valor.negativo {
    color: #f87171;
}

/* ── Loading skeleton ── */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Toast notifications ── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.3);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

/* ── Safe area for content above bottom nav ── */
.content-area {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
}

/* ── Modal overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 60;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: #1e293b;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ── Period selector ── */
.period-select {
    background: #1e293b;
    border: 1px solid #334155;
    color: white;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
}

.period-select:focus {
    outline: none;
    border-color: #fbbf24;
}
