/**
 * VIRTUDES E VÍCIOS - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Primary Colors */
    --gold-virtue: #F59E0B;
    --gold-virtue-light: #FCD34D;
    --gold-virtue-dark: #D97706;

    --red-vice: #DC2626;
    --red-vice-light: #F87171;
    --red-vice-dark: #B91C1C;

    --green-growth: #10B981;
    --green-growth-light: #34D399;
    --green-growth-dark: #059669;

    /* Neutral Colors */
    --bg-color: #FAFAFA;
    --surface-color: #FFFFFF;
    --surface-elevated: #FFFFFF;
    --border-color: #E5E7EB;
    --text-color: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Semantic Colors */
    --primary-color: var(--gold-virtue);
    --primary-light: var(--gold-virtue-light);
    --primary-dark: var(--gold-virtue-dark);
    --danger-color: var(--red-vice);
    --success-color: var(--green-growth);
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-Index */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal-backdrop: 1500;
    --z-modal: 2000;
    --z-toast: 2500;

    /* Safe Areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 65px;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-color: #0F172A;
    --surface-color: #1E293B;
    --surface-elevated: #334155;
    --border-color: #475569;
    --text-color: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #0F172A;
        --surface-color: #1E293B;
        --surface-elevated: #334155;
        --border-color: #475569;
        --text-color: #F1F5F9;
        --text-secondary: #CBD5E1;
        --text-muted: #94A3B8;
    }
}

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

html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--primary-color);
    color: white;
}

/* Scrollbar Styles */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: var(--radius-sm);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-sm);
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-color);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */
/* Show only on mobile (< 768px) */
.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}

/* Show only on desktop (>= 768px) */
.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: 100%;
    padding: var(--spacing-md);
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1140px;
    }
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-fixed);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 1.5rem;
}

.header-logo h1 {
    font-size: 1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold-virtue), var(--gold-virtue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .header-logo h1 {
        font-size: 1.25rem;
    }
}

.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: var(--spacing-xs);
    }

    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        font-size: 0.875rem;
        font-weight: 500;
        transition: all var(--transition-fast);
    }

    .desktop-nav .nav-link:hover {
        background: var(--bg-color);
        color: var(--text-color);
    }

    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }

    .desktop-nav .nav-link i {
        font-size: 1rem;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--surface-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    /* padding-bottom: var(--safe-area-bottom); */
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
}

.black-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: #000000;
    z-index: 1001;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: 64px;
    min-height: 48px;
}

.nav-item i {
    font-size: 1.25rem;
    transition: transform var(--transition-fast);
}

.nav-item span {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.15);
}

/* FAB Style for Center Item */
.nav-item-fab {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold-virtue), var(--gold-virtue-dark));
    border-radius: 50%;
    margin-top: -28px;
    color: white !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    flex-direction: row;
}

.nav-item-fab i {
    font-size: 1.5rem;
}

.nav-item-fab span {
    display: none;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: 44px;
    min-width: 44px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: var(--red-vice-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.btn-icon:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    background: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.section-header h2,
.section-header h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
}

.see-all-link {
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--gold-virtue), var(--gold-virtue-dark));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: white;
    margin-bottom: var(--spacing-lg);
}

.welcome-greeting h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.welcome-greeting p {
    opacity: 0.9;
    font-size: 0.875rem;
}

.welcome-stats {
    display: flex;
    justify-content: space-around;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* Quote Card */
.quote-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    border-left: 4px solid var(--gold-virtue);
}

.quote-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.quote-card blockquote {
    font-style: italic;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.quote-card cite {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Challenge Card */
.challenge-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.challenge-card.today-challenge {
    border: 2px solid var(--gold-virtue);
    background: linear-gradient(135deg, var(--surface-color), rgba(245, 158, 11, 0.05));
}

.challenge-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.challenge-virtue-badge {
    background: var(--gold-virtue-light);
    color: var(--gold-virtue-dark);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.challenge-xp {
    color: var(--success-color);
    font-weight: 700;
    font-size: 0.875rem;
}

.challenge-card h4 {
    margin-bottom: var(--spacing-xs);
}

.challenge-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.challenge-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.challenge-actions .btn {
    flex: 1;
}

/* Challenges Carousel */
.challenges-carousel-wrapper {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.challenges-carousel {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--spacing-xs) 0;
}

.challenges-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-card {
    flex: 0 0 100%;
    max-width: 100%;
    scroll-snap-align: center;
}

@media (min-width: 640px) {
    .carousel-card {
        flex: 0 0 calc(50% - var(--spacing-sm));
        max-width: calc(50% - var(--spacing-sm));
    }
}

@media (min-width: 1024px) {
    .carousel-card {
        flex: 0 0 calc(33.333% - var(--spacing-md));
        max-width: calc(33.333% - var(--spacing-md));
    }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.carousel-nav:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: -20px;
}

.carousel-next {
    right: -20px;
}

@media (max-width: 767px) {
    .carousel-prev {
        left: 0;
    }

    .carousel-next {
        right: 0;
    }
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.indicator {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.indicator.active {
    width: 24px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
}

.indicator:hover {
    background: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.stat-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.virtues-stat {
    border-left: 3px solid var(--gold-virtue);
}

.vices-stat {
    border-left: 3px solid var(--red-vice);
}

.challenges-stat {
    border-left: 3px solid var(--green-growth);
}

.balance-stat {
    border-left: 3px solid var(--info-color);
}

/* Activity List */
.activity-list {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.activity-item:hover {
    background: var(--bg-color);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-icon.virtue {
    background: rgba(245, 158, 11, 0.1);
}

.activity-icon.vice {
    background: rgba(220, 38, 38, 0.1);
}

.activity-icon.challenge {
    background: rgba(16, 185, 129, 0.1);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-xp {
    color: var(--success-color);
    font-weight: 700;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-md);
}

/* ========================================
   VIRTUES & VICES GRIDS
   ======================================== */
.virtues-grid,
.vices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.virtue-card,
.vice-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.virtue-card:hover,
.vice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.virtue-card {
    border-top: 4px solid var(--gold-virtue);
}

.vice-card {
    border-top: 4px solid var(--red-vice);
}

.virtue-header,
.vice-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.virtue-icon,
.vice-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.virtue-icon {
    background: rgba(245, 158, 11, 0.1);
}

.vice-icon {
    background: rgba(220, 38, 38, 0.1);
}

.virtue-info h4,
.vice-info h4 {
    margin-bottom: 2px;
}

.virtue-type,
.vice-opposite {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.virtue-description,
.vice-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.virtue-progress,
.vice-indicator {
    margin-bottom: var(--spacing-md);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: var(--spacing-xs);
}

.progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.virtue-progress .progress-fill {
    background: linear-gradient(90deg, var(--gold-virtue-light), var(--gold-virtue));
}

.vice-indicator .progress-fill {
    background: linear-gradient(90deg, var(--red-vice-light), var(--red-vice));
}

.virtue-stats,
.vice-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
}

.filter-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Assessment Card */
.assessment-card {
    background: linear-gradient(135deg, var(--surface-color), rgba(59, 130, 246, 0.05));
    border: 2px solid var(--info-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
}

.assessment-card h3 {
    margin-bottom: var(--spacing-sm);
}

.assessment-card p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   CHALLENGES SECTION
   ======================================== */
.challenge-stats-bar {
    display: flex;
    justify-content: space-around;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.challenge-stat {
    text-align: center;
}

.challenge-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary-color);
}

.challenge-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.challenges-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.challenge-item {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all var(--transition-fast);
}

.challenge-item:hover {
    border-color: var(--primary-color);
}

.challenge-item.completed {
    opacity: 0.7;
    background: var(--bg-color);
}

.challenge-item.completed .challenge-check {
    background: var(--success-color);
    color: white;
}

.challenge-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.challenge-check:hover {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.challenge-content {
    flex: 1;
    min-width: 0;
}

.challenge-content h4 {
    font-size: 0.875rem;
    margin-bottom: 2px;
}

.challenge-content p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.challenge-reward {
    text-align: right;
}

.challenge-reward .xp {
    display: block;
    color: var(--success-color);
    font-weight: 700;
    font-size: 0.875rem;
}

.challenge-reward .virtue-tag {
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* Badges Grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--spacing-md);
}

.badge-item {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.badge-item.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-item:not(.locked):hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.badge-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
}

.badge-desc {
    font-size: 0.625rem;
    color: var(--text-muted);
}

/* ========================================
   PROGRESS SECTION
   ======================================== */
.level-card {
    background: linear-gradient(135deg, var(--gold-virtue), var(--gold-virtue-dark));
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    color: white;
    margin-bottom: var(--spacing-lg);
}

.level-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.level-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-weight: 700;
}

.level-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.xp-progress {
    margin-top: var(--spacing-sm);
}

.xp-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: white;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.xp-text {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
    opacity: 0.9;
}

/* Charts */
.charts-container {
    display: grid;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
    .charts-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.chart-card h4 {
    margin-bottom: var(--spacing-md);
    font-size: 1rem;
}

.chart-wrapper {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Comparison Chart */
.comparison-bars {
    width: 100%;
}

.comparison-item {
    margin-bottom: var(--spacing-md);
}

.comparison-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.comparison-bar {
    height: 24px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
}

.comparison-fill {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    transition: width var(--transition-slow);
}

.comparison-fill.virtues {
    background: var(--gold-virtue);
}

.comparison-fill.vices {
    background: var(--red-vice);
}

/* Virtues Progress List */
.virtues-progress-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.virtue-progress-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.virtue-progress-icon {
    font-size: 1.25rem;
}

.virtue-progress-info {
    flex: 1;
}

.virtue-progress-name {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.virtue-progress-bar {
    height: 6px;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.virtue-progress-fill {
    height: 100%;
    background: var(--gold-virtue);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.virtue-progress-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 40px;
    text-align: right;
}

/* History Calendar */
.history-calendar {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.calendar-nav {
    display: flex;
    gap: var(--spacing-sm);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--spacing-xs);
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.calendar-day:hover {
    background: var(--bg-color);
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 700;
}

.calendar-day.has-activity {
    background: var(--gold-virtue-light);
    color: var(--gold-virtue-dark);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Activity History */
.activity-history {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* ========================================
   PROFILE SECTION
   ======================================== */
.profile-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .profile-card {
        flex-direction: row;
        text-align: left;
        gap: var(--spacing-lg);
    }
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-virtue-light), var(--gold-virtue));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

@media (min-width: 768px) {
    .profile-avatar {
        margin-bottom: 0;
    }
}

.avatar-emoji {
    font-size: 2.5rem;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    margin-bottom: var(--spacing-xs);
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-joined {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
}

/* Settings */
.settings-section {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    margin-bottom: var(--spacing-md);
    font-size: 1rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-item.danger .setting-label {
    color: var(--danger-color);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-weight: 500;
    font-size: 0.875rem;
}

.setting-value {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition-fast);
    border-radius: var(--radius-full);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--success-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* FAQ */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    color: var(--text-color);
    background: var(--bg-color);
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--surface-elevated);
}

.faq-icon {
    color: var(--text-color);
    transition: transform var(--transition-fast);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

.faq-answer[hidden] {
    display: none;
}

/* About */
.about-section {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
}

.app-version {
    font-size: 0.75rem;
    margin-bottom: var(--spacing-xs);
}

.app-tagline {
    font-style: italic;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal[hidden] {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-fast);
}

.modal-content {
    position: relative;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
}

/* Mobile: Modais menores com scroll */
@media (max-width: 767px) {
    .modal-content {
        max-height: 70vh;
        max-width: calc(100% - 32px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-large {
        max-height: 75vh;
    }

    .modal-small {
        max-height: 60vh;
    }
}

.modal-large {
    max-width: 640px;
}

.modal-small {
    max-width: 360px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--surface-color);
    z-index: 1;
}

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-body {
    padding: var(--spacing-lg);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--danger-color);
}

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
}

/* Avatar Picker */
.avatar-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.avatar-option {
    aspect-ratio: 1;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.avatar-option:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    background: rgba(245, 158, 11, 0.1);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--spacing-md) + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: calc(100% - var(--spacing-lg) * 2);
    max-width: 400px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .toast-container {
        bottom: var(--spacing-lg);
    }
}

.toast {
    background: var(--text-color);
    color: var(--bg-color);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: toastIn var(--transition-normal);
    pointer-events: auto;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--danger-color);
    color: white;
}

.toast.warning {
    background: var(--warning-color);
    color: white;
}

.toast.info {
    background: var(--info-color);
    color: white;
}

.toast.hiding {
    animation: toastOut var(--transition-normal) forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========================================
   SKELETON LOADING
   ======================================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-color) 25%,
            var(--surface-elevated) 50%,
            var(--bg-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: var(--spacing-sm);
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--spacing-md);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

@media (min-width: 768px) {
    .app-footer {
        margin-bottom: 0;
    }
}

.app-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

.b20-link {
    transition: all var(--transition-fast);
}

.b20-link:hover {
    text-decoration: underline;
}

/* ========================================
   UTILITIES
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

[hidden] {
    display: none !important;
}

/* ========================================
   ASSESSMENT FORM
   ======================================== */
.assessment-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.assessment-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-lg);
}

.assessment-section:last-of-type {
    border-bottom: none;
}

.assessment-section h4 {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.rating-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.rating-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

.rating-label {
    font-size: 0.875rem;
    flex: 1;
}

.rating-stars {
    display: flex;
    gap: 4px;
}

.rating-star {
    font-size: 1.25rem;
    color: var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.rating-star:hover,
.rating-star.active {
    color: var(--gold-virtue);
    transform: scale(1.1);
}

.assessment-notes {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 359px) {
    .welcome-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .challenge-actions {
        flex-direction: column;
    }
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Print Styles */
@media print {

    .app-header,
    .bottom-nav,
    .app-footer,
    .btn {
        display: none !important;
    }

    body {
        padding: 0;
    }

    .section {
        display: block !important;
        page-break-inside: avoid;
    }
}