/*
 * MiSalud — Estilos Globales App
 * Estética: Apple Health + Samsung Health + Premium Startup
 */

:root {
    --primary: #10b981;
    --primary-rgb: 16, 185, 129;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --secondary: #6366f1;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --dark: #1f2937;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --white: #ffffff;
    --bg-app: #f8fafc;
    --nav-height: 70px;
    --bottom-nav-height: 75px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --glass: rgba(255, 255, 255, 0.75);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* --- Base --- */
body.app-body {
    background-color: var(--bg-app);
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    padding-top: var(--nav-height);
    padding-bottom: 40px;
}

@media (max-width: 991.98px) {
    body.app-body {
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

/* --- Layout --- */
.main-content {
    min-height: calc(100vh - var(--nav-height));
    padding: 2rem 0;
}

/* --- Navbar --- */
.app-navbar {
    height: var(--nav-height);
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1030;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.brand-name {
    font-size: 1.4rem;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light);
}

/* --- Bottom Nav (Mobile) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding: 0 10px;
}

.bottom-nav-item {
    text-decoration: none;
    color: var(--gray-600);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.bottom-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

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

.bottom-nav-center {
    position: relative;
    top: -20px;
    background: transparent;
    border: none;
}

.bottom-nav-fab {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
    margin-bottom: 4px;
}

/* --- Cards --- */
.card-styled {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card-styled:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-header-styled {
    background: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
}

/* --- Stats --- */
.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: var(--white);
    position: relative;
    overflow: hidden;
}

.stat-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 4rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.progress-ring {
    width: 120px;
    height: 120px;
}

/* --- Modals --- */
.modal-styled {
    border-radius: var(--radius-lg);
    border: none;
}

.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 3rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--gray-100);
    position: relative;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-icon-wrap {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.upload-preview-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* --- UI Components --- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--gray-600);
}

.health-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.score-ring {
    font-weight: 800;
    color: var(--primary);
}

/* --- Auth Pages --- */
.auth-bg {
    background: radial-gradient(circle at top left, var(--primary-light), transparent),
                radial-gradient(circle at bottom right, #e0e7ff, transparent);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-card {
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- PWA --- */
.pwa-install-banner {
    position: fixed;
    bottom: 90px;
    left: 20px;
    right: 20px;
    background: var(--white);
    border-radius: 16px;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1050;
}

@media (min-width: 992px) {
    .pwa-install-banner {
        width: 350px;
        left: auto;
    }
}

/* Animations */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-up {
    animation: slideUp 0.5s ease forwards;
}

/* Auth helpers */
.hr-text {
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hr-text::before, .hr-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.hr-text:not(:empty)::before {
    margin-right: .75rem;
}

.hr-text:not(:empty)::after {
    margin-left: .75rem;
}
