/* ========================================
   PeladaPro - Design System
   Sistema completo de estilos baseado nas referências
   ======================================== */

/* ========================================
   Variáveis CSS
   ======================================== */
:root {
    /* Cores Principais */
    --color-primary: #13ec13;
    --color-primary-dark: #0fb30f;
    --color-primary-light: #6fff6f;

    /* Backgrounds */
    --bg-dark: #102210;
    --bg-dark-secondary: #193319;
    --bg-dark-tertiary: #224422;
    --bg-light: #f6f8f6;
    --bg-light-secondary: #ffffff;

    /* Borders */
    --border-dark: #326732;
    --border-light: #e5e7eb;

    /* Text Colors */
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #92c992;
    --text-tertiary-dark: #6b8a6b;
    --text-primary-light: #1a1a1a;
    --text-secondary-light: #6b7280;

    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* Tipografia */
    --font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.25rem;
    /* 20px */
    --font-size-2xl: 1.5rem;
    /* 24px */
    --font-size-3xl: 2rem;
    /* 32px */
    --font-size-4xl: 2.5rem;
    /* 40px */

    /* Espaçamentos */
    --spacing-1: 0.25rem;
    /* 4px */
    --spacing-2: 0.5rem;
    /* 8px */
    --spacing-3: 0.75rem;
    /* 12px */
    --spacing-4: 1rem;
    /* 16px */
    --spacing-5: 1.25rem;
    /* 20px */
    --spacing-6: 1.5rem;
    /* 24px */
    --spacing-8: 2rem;
    /* 32px */
    --spacing-10: 2.5rem;
    /* 40px */
    --spacing-12: 3rem;
    /* 48px */

    /* Border Radius */
    --radius-sm: 0.5rem;
    /* 8px */
    --radius-md: 1rem;
    /* 16px */
    --radius-lg: 1.5rem;
    /* 24px */
    --radius-xl: 2rem;
    /* 32px */
    --radius-2xl: 3rem;
    /* 48px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow-primary: 0 0 30px rgba(19, 236, 19, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Reset e Base
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    color: var(--text-primary-light);
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
    /* Prevent body scroll */
}

body.theme-dark {
    background-color: var(--bg-dark);
    color: var(--text-primary-dark);
}

/* ========================================
   Tipografia
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary-light);
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6 {
    color: var(--text-primary-dark);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

p {
    margin-bottom: var(--spacing-4);
    color: var(--text-secondary-light);
}

.theme-dark p {
    color: var(--text-secondary-dark);
}

/* ========================================
   Botões
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-4) var(--spacing-6);
    font-size: var(--font-size-base);
    font-weight: 700;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #000000;
    box-shadow: 0 4px 14px 0 rgba(19, 236, 19, 0.39);
}

.theme-dark .btn-primary {
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(19, 236, 19, 0.4);
}

.btn-primary:active {
    transform: scale(0.95);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid rgba(19, 236, 19, 0.3);
}

.btn-secondary:hover {
    background: rgba(19, 236, 19, 0.1);
    border-color: var(--color-primary);
}

.btn-ghost {
    background: #ffffff;
    color: var(--text-primary-light);
    border: 1px solid var(--border-light);
}

.theme-dark .btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    padding: var(--spacing-2) var(--spacing-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--spacing-5) var(--spacing-8);
    font-size: var(--font-size-lg);
    height: 3.5rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Inputs e Forms
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-5);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary-light);
    margin-bottom: var(--spacing-2);
    padding-left: var(--spacing-1);
}

.form-input {
    width: 100%;
    padding: var(--spacing-4) var(--spacing-6);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--text-primary-light);
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    outline: none;
    transition: all var(--transition-base);
}

.theme-dark .form-input {
    color: var(--text-primary-dark);
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
}

.form-input::placeholder {
    color: var(--text-secondary-dark);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(19, 236, 19, 0.1);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    right: var(--spacing-5);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary-dark);
    cursor: pointer;
    transition: color var(--transition-base);
}

.input-icon:hover {
    color: var(--color-primary);
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--spacing-6);
    box-shadow: var(--shadow-sm);
}

.card-header {
    margin-bottom: var(--spacing-4);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary-dark);
    margin-bottom: var(--spacing-2);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary-dark);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5rem;
    background: #ffffff;
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-3) var(--spacing-4) var(--spacing-4);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-1);
    color: var(--text-secondary-light);
    text-decoration: none;
    transition: color var(--transition-base);
    cursor: pointer;
    flex: 1;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item-icon {
    font-size: 1.5rem;
}

.nav-item-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.badge-primary {
    background: rgba(19, 236, 19, 0.1);
    color: var(--color-primary);
}

/* ========================================
   Avatar
   ======================================== */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border-dark);
}

.avatar-lg {
    width: 5rem;
    height: 5rem;
}

.avatar-xl {
    width: 8rem;
    height: 8rem;
    border-width: 4px;
    border-color: var(--color-primary);
}

/* ========================================
   Utilities
   ======================================== */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 var(--spacing-6);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-0 {
    margin-top: 0;
}

.mt-2 {
    margin-top: var(--spacing-2);
}

.mt-4 {
    margin-top: var(--spacing-4);
}

.mt-6 {
    margin-top: var(--spacing-6);
}

.mt-8 {
    margin-top: var(--spacing-8);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-2 {
    margin-bottom: var(--spacing-2);
}

.mb-4 {
    margin-bottom: var(--spacing-4);
}

.mb-6 {
    margin-bottom: var(--spacing-6);
}

.mb-8 {
    margin-bottom: var(--spacing-8);
}

.p-0 {
    padding: 0;
}

.p-4 {
    padding: var(--spacing-4);
}

.p-6 {
    padding: var(--spacing-6);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--spacing-2);
}

.gap-4 {
    gap: var(--spacing-4);
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.hidden {
    display: none !important;
}

.block {
    display: block;
}

/* ========================================
   Page Layouts
   ======================================== */
.page {
    min-height: 100vh;
    padding-bottom: 5rem;
    /* espaço para bottom nav */
}

.page-header {
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-4) var(--spacing-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.page-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary-light);
}

.theme-dark .page-title {
    color: var(--text-primary-dark);
}

.page-content {
    padding: var(--spacing-6);
    overflow-y: auto;
    max-height: calc(100vh - 10rem);
    /* Compensate for header and bottom nav */
    -webkit-overflow-scrolling: touch;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary-light);
    cursor: pointer;
    transition: all var(--transition-base);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.fade-in {
    animation: fadeIn var(--transition-base) ease-out;
}

.slide-up {
    animation: slideUp var(--transition-slow) ease-out;
}

/* ========================================
   Loading States
   ======================================== */
.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 380px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-4);
    }
}

/* ========================================
   Material Icons
   ======================================== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ========================================
   Stats Carousel (Shared)
   ======================================== */
.stats-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-left: 0.5rem;
}

.stats-carousel::-webkit-scrollbar {
    display: none;
}

.stats-card {
    flex: 0 0 140px;
    min-width: 140px;
    padding: 1.5rem;
    text-align: center;
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease;
    border: 1px solid var(--border-light);
}

.stats-card:active {
    transform: scale(0.95);
}

/* ========================================
   Stat Modal Styles (Shared)
   ======================================== */
.stat-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 2.5rem 2.5rem 0 0;
    padding: 2rem;
    z-index: 10001;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    margin: 0 auto;
    transform: translateY(100%);
    will-change: transform;
}

.stat-modal.active {
    transform: translateY(0);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    backdrop-filter: blur(4px);
}

.counter-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem 0;
}

.counter-btn {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    background: transparent;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.counter-btn:active {
    background: var(--color-primary);
    color: white;
}

.counter-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary-light);
    min-width: 5rem;
    text-align: center;
}