/**
 * San Patrick - Estilos CSS Principal
 * Versión estabilizada - Header y Footer fijos
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --color-marron: #8B5A2B;
    --color-tierra: #A0522D;
    --color-tierra-oscuro: #654321;
    --color-crema: #F5F5F0;
    --color-accent: #006847;
    --color-texto: #333333;
    --color-texto-claro: #666666;
    --color-success: #198754;
    --color-danger: #dc3545;
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-xxl: 40px;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-texto);
    background-color: var(--color-crema);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--color-marron);
    text-decoration: none;
    transition: var(--transition);
}

/* ============================================
   CONTENEDOR
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER - ESTRUCTURA ESTABLE
   ============================================ */
.header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 65px;
}

/* Logo - FIJO */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 70px;
}

.logo-img {
    height: 55px;
    width: auto;
    display: block;
}

/* Navegación escritorio */
.nav-main {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
    margin: 0 10px;
}

.nav-main a {
    color: var(--color-tierra-oscuro);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-family: 'Roboto Condensed', Arial Narrow, sans-serif;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-main a:hover,
.nav-main a.active {
    background: var(--color-marron);
    color: white;
}

/* Usuario - FIJO a la derecha */
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 90px;
    justify-content: flex-end;
}

.btn-user {
    color: var(--color-tierra);
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--color-crema);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-user:hover {
    background: var(--color-marron);
    color: white;
}

/* Botón menú móvil - OCULTO en escritorio */
.nav-toggle {
    display: none;
    background: var(--color-marron);
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 20px;
    padding: 10px 14px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   HEADER - TABLET (max 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .header-container {
        padding: 10px 15px;
        min-height: 70px;
        gap: 10px;
    }
    
    .logo {
        order: 1;
        flex: 0 0 auto;
    }
    
    .logo-img {
        height: 55px;
    }
    
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
        flex: 0 0 auto;
    }
    
    .nav-main {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
        padding: 10px 0;
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-main.active {
        display: flex;
    }
    
    .nav-main a {
        width: 100%;
        text-align: left;
        padding: 15px 25px;
        border-radius: 0;
        border-bottom: 1px solid var(--color-crema);
        font-size: 15px;
    }
    
    .nav-main a:last-child {
        border-bottom: none;
    }
    
    .header-user {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
    }
    
    .header-user .btn-user span {
        display: none;
    }
    
    .btn-user {
        padding: 8px 12px;
    }
}

/* ============================================
   HEADER - MÓVIL (max 768px)
   ============================================ */
@media (max-width: 768px) {
    .header-container {
        padding: 8px 10px;
        min-height: 56px;
        gap: 8px;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .nav-toggle {
        padding: 8px 10px;
        font-size: 16px;
    }
    
    .btn-user {
        padding: 6px 10px;
        font-size: 14px;
    }
}

/* ============================================
   HEADER - MÓVIL PEQUEÑO (max 380px)
   ============================================ */
@media (max-width: 380px) {
    .header-container {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .nav-toggle {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .btn-user {
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* ============================================
   HERO - FOTO PRINCIPAL
   ============================================ */
.hero-foto {
    background: #1a1a1a;
}

.hero-foto img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-foto .caption {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 20px;
    font-size: 14px;
    text-align: center;
}

@media (max-width: 768px) {
    .hero-foto .caption {
        font-size: 12px;
        padding: 10px 15px;
    }
}

/* ============================================
   SECCIONES GENERALES
   ============================================ */
.section-intro {
    padding: 50px 0;
    background: white;
}

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.intro-text {
    line-height: 1.9;
}

.intro-text p {
    margin-bottom: 15px;
}

.intro-text strong {
    color: var(--color-marron);
}

.intro-text em {
    background: var(--color-crema);
    padding: 2px 5px;
    border-radius: 3px;
}

@media (max-width: 992px) {
    .intro-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FOTOS HISTÓRICAS
   ============================================ */
.intro-fotos {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.foto-historica {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: white;
}

.foto-historica img {
    width: 100%;
    height: auto;
    display: block;
}

.foto-historica .caption {
    padding: 15px;
    font-size: 14px;
    color: var(--color-texto-claro);
    background: var(--color-crema);
}

.fotos-secundarias {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .fotos-secundarias {
        grid-template-columns: 1fr;
    }
}

.fuente-fotos {
    background: var(--color-tierra-oscuro);
    color: white;
    padding: 15px;
    border-radius: var(--border-radius);
    font-size: 14px;
}

.fuente-fotos a {
    color: #FFD700;
}

.fotos-ulak {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* ============================================
   SECCIÓN COLABORA
   ============================================ */
.section-colabora {
    padding: 50px 0;
    background: var(--color-crema);
}

.colabora-box {
    display: flex;
    gap: 30px;
    align-items: center;
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--color-accent);
}

.colabora-icon {
    font-size: 3rem;
    color: var(--color-accent);
}

.colabora-content h3 {
    color: var(--color-marron);
    margin-bottom: 10px;
}

.colabora-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .colabora-box {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .colabora-buttons {
        flex-direction: column;
    }
}

/* ============================================
   SECCIÓN DATOS
   ============================================ */
.section-datos {
    padding: 40px 0;
    background: var(--color-tierra-oscuro);
}

.datos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
    color: white;
}

.dato-item .dato-numero {
    font-size: 3rem;
    font-weight: 700;
    color: #FFD700;
    display: block;
}

.dato-item .dato-label {
    font-size: 14px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .datos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dato-item .dato-numero {
        font-size: 2rem;
    }
}

/* ============================================
   SECCIÓN ENLACES
   ============================================ */
.section-enlaces {
    padding: 50px 0;
    background: white;
}

.enlaces-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.enlace-card {
    background: var(--color-crema);
    padding: 30px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.enlace-card:hover {
    border-color: var(--color-marron);
    transform: translateY(-5px);
}

.enlace-card i {
    font-size: 2.5rem;
    color: var(--color-marron);
    margin-bottom: 15px;
    display: block;
}

.enlace-card h4 {
    color: var(--color-marron);
    margin-bottom: 10px;
}

.enlace-card p {
    color: var(--color-texto-claro);
    font-size: 14px;
}

@media (max-width: 992px) {
    .enlaces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .enlaces-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TRIPULACIÓN
   ============================================ */
.section-tripulacion {
    padding: 50px 0;
}

.section-tripulacion.section-alt {
    background: var(--color-crema);
}

.tripulacion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tripulante-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tripulante-foto {
    width: 100%;
    height: auto;
    display: block;
    background: var(--color-crema);
}

.foto-placeholder {
    width: 100%;
    height: 150px;
    background: var(--color-crema);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-tierra);
    font-size: 3rem;
}

.tripulante-info {
    padding: 15px;
}

.tripulante-nombre {
    font-weight: 700;
    color: var(--color-marron);
    margin-bottom: 5px;
}

.tripulante-cargo {
    color: var(--color-tierra);
    font-size: 14px;
}

.tripulante-datos {
    color: var(--color-texto-claro);
    font-size: 13px;
}

.tripulante-badge {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 20px;
    margin-top: 8px;
}

@media (max-width: 992px) {
    .tripulacion-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tripulacion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--color-marron);
    color: white;
}

.btn-primary:hover {
    background: var(--color-tierra-oscuro);
    color: white;
}

.btn-secondary {
    background: var(--color-accent);
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #128C7E;
    color: white;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-family);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-marron);
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-family);
    background: white;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-marron);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-tierra-oscuro);
}

.form-text {
    font-size: 13px;
    color: var(--color-texto-claro);
    margin-top: 5px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-check-input {
    margin-top: 4px;
}

.form-check-label {
    font-size: 14px;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background: #f8d7da;
    color: #842029;
}

.alert-warning {
    background: #fff3cd;
    color: #664d03;
}

.alert-info {
    background: #cff4fc;
    color: #055160;
}

/* ============================================
   FOOTER - ESTABLE
   ============================================ */
.footer {
    background: var(--color-tierra-oscuro);
    color: white;
    padding: 50px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer h4 {
    color: #FFD700;
    margin-bottom: 15px;
}

.footer-about {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.9;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
}

.footer-links a:hover {
    color: white;
}

.footer-newsletter .form-control {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: white;
}

.footer-newsletter .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.footer-bottom a {
    color: #FFD700;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PÁGINAS - HERO
   ============================================ */
.hero {
    padding: 50px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    color: var(--color-marron);
    margin-bottom: 15px;
}

.hero .lead {
    font-size: 1.1rem;
    color: var(--color-texto-claro);
}

.hero-page {
    background: linear-gradient(135deg, var(--color-marron) 0%, var(--color-tierra-oscuro) 100%);
    color: white;
    padding: 50px 0;
    text-align: center;
}

.hero-page h1 {
    color: white;
}

.hero-page .lead {
    color: rgba(255,255,255,0.9);
}

/* Hero Registro */
.hero-registro {
    background: rgba(139,90,43,0.3);
    color: var(--color-marron);
    border-bottom: 4px solid var(--color-tierra);
    margin-bottom: var(--spacing-xxl);
}

.hero-registro h1 {
    color: var(--color-marron);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.card-body {
    padding: 25px;
}

/* ============================================
   SECCIONES
   ============================================ */
.section {
    padding: 50px 0;
}

.section-title {
    font-size: 1.8rem;
    color: var(--color-marron);
    text-align: center;
    margin-bottom: 30px;
}

/* ============================================
   REGISTRO / LOGIN
   ============================================ */
.registro-section,
.login-section {
    padding: var(--spacing-xl) 0;
}

.registro-card,
.login-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    max-width: 700px;
    margin: 0 auto;
}

.registro-card h2,
.login-card h2 {
    color: var(--color-marron);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-tierra);
}

.registro-card h2 i,
.login-card h2 i {
    margin-right: 10px;
}

.btn-registro,
.btn-login {
    background: var(--color-marron);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 30px;
    transition: all 0.3s;
    width: 100%;
    cursor: pointer;
}

.btn-registro:hover,
.btn-login:hover {
    background: var(--color-tierra-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139,90,43,0.3);
    color: white;
}

.info-box {
    background: var(--color-crema);
    border-left: 4px solid var(--color-accent);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.info-box p {
    margin: 0;
    color: var(--color-tierra-oscuro);
    font-size: 0.95rem;
}

.relacion-help {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
}

/* ============================================
   GRID Y UTILIDADES
   ============================================ */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.form-group {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.gap-2 {
    gap: 10px;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

/* Margins */
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.my-4 { margin-top: 20px; margin-bottom: 20px; }

/* Text */
.text-muted { color: var(--color-texto-claro); }
.text-center { text-align: center; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-accent { color: var(--color-accent); }

/* Buttons */
.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 1;
}

/* Separadores */
hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 20px 0;
}

/* Links documento */
.link-documento {
    color: #FFD700;
    text-decoration: underline;
}

.link-documento:hover {
    color: white;
}
/* ============================================
   DROPDOWN MENÚ INVESTIGACIÓN
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    color: var(--color-tierra-oscuro);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-family: 'Roboto Condensed', Arial Narrow, sans-serif;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active {
    background: var(--color-marron);
    color: white;
}

.nav-dropdown-toggle .fa-caret-down {
    font-size: 10px;
    transition: transform 0.3s;
}

.nav-dropdown.open .fa-caret-down {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    overflow: hidden;
    z-index: 1001;
    margin-top: 5px;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: var(--color-tierra-oscuro);
    font-size: 14px;
    border-bottom: 1px solid var(--color-crema);
    transition: var(--transition);
}

.nav-dropdown-menu a:last-child {
    border-bottom: none;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: var(--color-marron);
    color: white;
}

.nav-dropdown-menu a i {
    width: 18px;
    text-align: center;
}

/* Dropdown en tablet y móvil */
@media (max-width: 1024px) {
    .nav-dropdown {
        width: 100%;
    }
    
    .nav-dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 15px 25px;
        border-radius: 0;
        border-bottom: 1px solid var(--color-crema);
        justify-content: flex-start;
    }
    
    .nav-dropdown-toggle .fa-caret-down {
        margin-left: auto;
    }
    
    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        margin-top: 0;
        border-radius: 0;
        background: var(--color-crema);
    }
    
    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }
    
    .nav-dropdown-menu a {
        padding: 12px 25px 12px 45px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
}
