/**
 * ONA Club - Estilos Principales
 * Reset, layout general, tipografia base y utilidades
 */

@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@400;500;600;700;800&family=Montserrat:wght@400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-dark);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

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

ul, ol {
    list-style: none;
}

/* === Layout principal === */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#app-content {
    flex: 1;
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 16px);
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container--narrow {
    max-width: var(--container-narrow);
}

/* === Navbar Superior === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    z-index: var(--z-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.navbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.navbar__logo-text {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    letter-spacing: var(--letter-spacing-wide);
}

.navbar__logo-sub {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: var(--letter-spacing-wider);
    text-transform: uppercase;
}

.navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

.navbar__icon-btn:hover {
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb), 0.08);
}

.navbar__icon-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: var(--border-radius-full);
    background: var(--color-error);
}

/* === Navegacion inferior (mobile) === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-navbar);
    padding-bottom: env(safe-area-inset-bottom, 0);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
    border-radius: var(--border-radius);
    min-width: 56px;
    text-align: center;
}

.bottom-nav__item:hover,
.bottom-nav__item.active {
    color: var(--color-primary);
}

.bottom-nav__item.active {
    background: rgba(var(--color-primary-rgb), 0.08);
}

.bottom-nav__item svg {
    width: 22px;
    height: 22px;
}

.bottom-nav__label {
    font-size: 0.625rem;
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    font-weight: var(--font-weight-medium);
}

/* === Contenido con padding para navbar === */
.page {
    padding-top: calc(var(--navbar-height) + var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: var(--space-xl);
    animation: fadeIn 0.3s ease;
}

.page-header {
    padding-top: calc(var(--navbar-height) + var(--space-md));
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    padding-bottom: var(--space-sm);
}

/* === Tipografia === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-heading);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
}

h1 { font-size: var(--font-size-3xl); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-semibold); }
h3 { font-size: var(--font-size-xl); font-weight: var(--font-weight-semibold); }
h4 { font-size: var(--font-size-lg); font-weight: var(--font-weight-medium); }

.page-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-2xl);
    color: var(--text-heading);
    margin-bottom: var(--space-lg);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.text-gold {
    color: var(--color-primary);
}

.text-center { text-align: center; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-muted { color: var(--text-muted); }

/* === Animaciones === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.animate-fade-in {
    animation: fadeIn 0.4s ease both;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease both;
}

/* Stagger delay para listas */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* === Utilidades === */
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-sm { margin-left: var(--space-sm); }

.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

.skeleton--text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton--title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton--avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-full);
}

/* === Toast notifications === */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-md));
    right: var(--space-md);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    font-size: var(--font-size-sm);
}

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info { border-left: 3px solid var(--color-info); }

.toast__close {
    margin-left: auto;
    color: var(--text-muted);
    padding: 4px;
}

/* === Scrollbar personalizada === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* === Loading spinner === */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.loader__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-md);
    color: var(--text-muted);
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-muted);
    opacity: 0.4;
}

.empty-state__title {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state__text {
    font-size: var(--font-size-sm);
    max-width: 340px;
    margin: 0 auto;
}

/* === Divider === */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-lg) 0;
}

.divider--gold {
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

/* === Seccion header === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-header__title {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    color: var(--text-heading);
}

.section-header__link {
    font-size: var(--font-size-sm);
    color: var(--color-primary);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    font-weight: var(--font-weight-medium);
}
