/* ============================================
   MenopausiaCare - Estilos Profesionales
   ============================================ */

:root {
    --primary-color: #8B4C9F;
    --primary-dark: #6B3A7F;
    --primary-light: #B87BCF;
    --secondary-color: #E8D5E8;
    --accent-color: #FF6B9D;
    --accent-light: #FFB3D1;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.display-1, .display-2, .display-3, .display-4, .display-5 {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    letter-spacing: -0.01em;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.9) !important;
    transition: var(--transition);
    padding: 0.5rem 1rem !important;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

/* Menú responsive vertical */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        padding-top: 0.5rem;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 8px;
    }
    
    .navbar-nav {
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        width: 100%;
        padding: 0.75rem 1.25rem !important;
        display: flex;
        align-items: center;
        font-size: 1rem;
        border-radius: 0;
        margin: 0;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(255,255,255,0.15) !important;
        padding-left: 1.5rem !important;
    }
    
    .navbar-nav .nav-link i {
        width: 24px;
        font-size: 1.1rem;
    }
    
    .navbar-nav .border-bottom {
        border-bottom: 1px solid rgba(255,255,255,0.2) !important;
    }
    
    .navbar-nav .navbar-text {
        padding: 0.75rem 1.25rem;
        display: block;
        width: 100%;
        font-weight: 600;
    }
}

/* Botones */
.btn {
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: none;
    letter-spacing: 0.01em;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-light {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-light:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

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

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* Hero Section - Full Width */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--accent-color) 100%);
    padding: 120px 0;
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .hero-section .container {
        padding: 0 20px;
    }
}

/* Video de fondo */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}

/* Overlay para mejorar legibilidad */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 76, 159, 0.85) 0%, rgba(184, 123, 207, 0.75) 50%, rgba(255, 107, 157, 0.85) 100%);
    z-index: 1;
}

@media (max-width: 768px) {
    .hero-overlay {
        /* Overlay más oscuro en móviles para mejor legibilidad pero permitir ver el video */
        background: linear-gradient(135deg, rgba(139, 76, 159, 0.75) 0%, rgba(184, 123, 207, 0.7) 50%, rgba(255, 107, 157, 0.75) 100%);
    }
}

/* CTA Sections - Full Width */
.bg-gradient-accent {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.bg-gradient-accent .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .bg-gradient-accent .container {
        padding: 0 20px;
    }
}

/* Asegurar que todos los títulos en CTAs con gradiente sean blancos */
.bg-gradient-accent h1,
.bg-gradient-accent h2,
.bg-gradient-accent h3,
.bg-gradient-accent h4,
.bg-gradient-accent h5,
.bg-gradient-accent h6 {
    color: white !important;
}

.bg-gradient-accent p {
    color: rgba(255, 255, 255, 0.95) !important;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    color: white;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-section .lead {
    color: rgba(255,255,255,0.95);
    font-size: 1.3rem;
    line-height: 1.8;
}

/* Secciones */
section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-color);
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Formularios */
.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 76, 159, 0.15);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-range {
    height: 8px;
}

.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 500;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e9ecef;
}

.timeline .d-flex {
    position: relative;
    margin-bottom: 2rem;
}

.timeline .d-flex:last-child {
    margin-bottom: 0;
}

/* Iconos */
.bi {
    font-size: 1.2em;
}

/* Espaciados */
.mb-section {
    margin-bottom: 4rem;
}

.py-section {
    padding: 80px 0;
}

/* Gradientes de fondo */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

/* Sombras personalizadas */
.shadow-custom {
    box-shadow: var(--shadow-lg);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Footer */
footer {
    margin-top: 0;
    background-color: #1a1a1a !important;
}

/* Cuando hay un CTA (bg-gradient-accent) antes del footer, no necesita margin-top */
.bg-gradient-accent {
    margin-bottom: 0;
}

/* Si el último elemento antes del footer no es un CTA, agregar espaciado */
main > section:last-of-type:not(.bg-gradient-accent) {
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    main > section:last-of-type:not(.bg-gradient-accent) {
        margin-bottom: 2rem;
    }
}

footer h5,
footer h6 {
    color: white !important;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: white !important;
    text-decoration: underline;
}

footer .text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Responsive - Navbar ya tiene estilos arriba */

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        min-height: 500px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-section .display-3 {
        font-size: 2rem !important;
    }
    
    .hero-video {
        /* Mostrar video en móviles con buena visibilidad */
        display: block;
        opacity: 0.6;
    }
    
    .hero-section {
        /* Asegurar que el gradiente se muestre en móviles como fallback */
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--accent-color) 100%);
    }
    
    .hero-overlay {
        /* Overlay más oscuro en móviles para mejor legibilidad */
        background: linear-gradient(135deg, rgba(139, 76, 159, 0.9) 0%, rgba(184, 123, 207, 0.85) 50%, rgba(255, 107, 157, 0.9) 100%);
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    section {
        padding: 40px 0;
    }
    
    .py-section {
        padding: 40px 0;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Hero y CTAs ya están a full width */
    .hero-section,
    .bg-gradient-accent {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Padding interno en todas las secciones para móviles - más generoso */
    .hero-section .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    section .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Aumentar padding en pantallas muy pequeñas */
    @media (max-width: 576px) {
        .hero-section .container,
        section .container,
        .bg-gradient-accent .container {
            padding-left: 20px;
            padding-right: 20px;
        }
    }
    
    .bg-gradient-accent .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Padding adicional en contenido para que no se vea pegado a los bordes */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Asegurar que las filas con gap tengan padding adecuado */
    .row.g-4 {
        margin-left: 0;
        margin-right: 0;
    }
    
    .row.g-4 > * {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Padding en elementos dentro de secciones */
    section h1,
    section h2,
    section h3,
    section p,
    section .lead {
        padding-left: 0;
        padding-right: 0;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .hero-section .d-flex.gap-4 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .hero-section .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    .hero-image i {
        font-size: 120px !important;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .bg-gradient-accent .lead {
        font-size: 1.1rem !important;
    }
    
    .bg-gradient-accent .d-flex.gap-4 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    /* Para páginas públicas, quitar padding del container-fluid */
    .public-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Para páginas con usuario (dashboard), mantener padding */
    .dashboard-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Main en páginas públicas sin padding */
    main.p-0 {
        padding: 0 !important;
    }
    
    /* Main en dashboards con padding */
    main:not(.p-0) {
        padding: 1rem !important;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 50px 0;
        min-height: 450px;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    section .container {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.625rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Efectos hover */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md) !important;
}

/* Utilidades */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-light-custom {
    background-color: #f8f9fa;
}

.border-radius-custom {
    border-radius: var(--border-radius);
}

/* Tabs mejorados */
.nav-tabs {
    border-bottom: 2px solid #e9ecef;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

/* Listas mejoradas */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 1rem;
    transition: var(--transition);
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item:first-child {
    border-top: none;
}

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

/* Mejoras en tablas */
.table-hover tbody tr {
    transition: var(--transition);
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Cards mejoradas */
.card-header {
    font-weight: 600;
}

/* Formularios mejorados */
.form-label.fw-semibold {
    font-weight: 600;
    color: var(--dark-color);
}

/* Badges mejorados */
.badge {
    font-weight: 500;
    padding: 0.4rem 0.75rem;
}

/* Botones de grupo mejorados */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Mejoras en inputs */
.input-group .btn {
    border-left: none;
}

.input-group .form-control:focus + .btn {
    border-color: var(--primary-color);
}

/* Estados vacíos mejorados */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state i {
    font-size: 64px;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* Mejoras en cards de estadísticas */
.card .card-body h3,
.card .card-body h4 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
}

/* Mejoras en badges */
.badge i {
    font-size: 0.875em;
}

/* Mejoras en alertas */
.alert {
    border-left: 4px solid;
}

.alert-danger {
    border-left-color: var(--danger-color);
}

.alert-warning {
    border-left-color: var(--warning-color);
}

.alert-info {
    border-left-color: var(--info-color);
}

.alert-success {
    border-left-color: var(--success-color);
}

/* Mejoras en formularios */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(139, 76, 159, 0.15);
}

/* Mejoras en tablas */
.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Transiciones suaves */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* Mejoras de accesibilidad */
a {
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-decoration: none;
}

button:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Tablas responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center {
        align-items: flex-start !important;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .row.g-4 > * {
        margin-bottom: 1rem;
    }
}

/* Mejoras para formularios en móviles */
@media (max-width: 576px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: 100%;
    }
}
