/**
 * GATES Portal - About Us Section
 * Professional UI/UX Design - v1.0
 * 
 * Características:
 * - Diseño modular con grid profesional
 * - Animaciones suaves y fluidas
 * - Glassmorphism effects
 * - Responsive design premium
 * - Gradientes modernos
 */

/* ========================================
   VARIABLES Y TEMAS
   ======================================== */
:root {
    /* Colores principales */
    --gates-primary: #1B9B9E;
    --gates-primary-dark: #157376;
    --gates-primary-light: #23B5B8;
    --gates-secondary: #2C3E50;
    --gates-accent: #F39C12;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #1B9B9E 0%, #23B5B8 100%);
    --gradient-secondary: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    --gradient-accent: linear-gradient(135deg, #F39C12 0%, #F1C40F 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

    /* Sombras profesionales */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(27, 155, 158, 0.3);

    /* Espaciados */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transiciones */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   SECCIÓN ABOUT - CONTENEDOR PRINCIPAL
   ======================================== */
#nosotros {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* Efecto de fondo decorativo */
#nosotros::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(27, 155, 158, 0.03) 0%, transparent 70%);
    pointer-events: none;
    animation: float 20s ease-in-out infinite;
}

#nosotros::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(circle, rgba(243, 156, 18, 0.02) 0%, transparent 70%);
    pointer-events: none;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ========================================
   HEADER DE SECCIÓN
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--gates-secondary);
    margin-bottom: var(--spacing-md);
    position: relative;
    display: inline-block;
    padding: 0 var(--spacing-lg);
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.title-underline {
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    margin: var(--spacing-sm) auto;
    border-radius: 2px;
}

/* ========================================
   GRID MODULAR - DISEÑO PROFESIONAL
   ======================================== */
.about-grid-modular {
    display: grid;
    /* 3 columnas en desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    position: relative;
    z-index: 1;
    padding: var(--spacing-lg) 0;
}

/* Si solo hay 1 bloque, ocupar todo el ancho */
.about-grid-modular:has(.about-block:only-child) {
    grid-template-columns: 1fr;
}

/* Si hay 2 bloques, mostrar 2 columnas */
.about-grid-modular:has(.about-block:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
}

/* ========================================
   BLOQUES - CONTENEDOR DE ITEMS
   ======================================== */
.about-block {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.about-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.about-block:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.about-block:hover::before {
    transform: scaleX(1);
}

/* Título del bloque */
.block-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gates-primary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid rgba(27, 155, 158, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.block-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ========================================
   ITEMS - CONTENIDO INDIVIDUAL
   ======================================== */
.about-item {
    margin-bottom: var(--spacing-xl);
    padding: 0;
    transition: all var(--transition-normal);
}

.about-item:last-child {
    margin-bottom: 0;
}

/* Título del item - OPCIONAL, solo se muestra si existe */
.item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gates-secondary);
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-sm);
    border-left: 3px solid var(--gates-primary);
}

/* Contenido del item */
.item-content {
    color: #555;
    line-height: 1.8;
    font-size: 1rem;
}

.item-content p {
    margin-bottom: var(--spacing-sm);
}

.item-content p:last-child {
    margin-bottom: 0;
}

.item-content strong {
    color: var(--gates-primary);
    font-weight: 600;
}

.item-content em {
    color: var(--gates-secondary);
    font-style: italic;
}

.item-content a {
    color: var(--gates-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.item-content a:hover {
    border-bottom-color: var(--gates-primary);
}

/* ========================================
   TIPO: STANDARD - TEXTO ENRIQUECIDO
   ======================================== */
.item-standard .item-content {
    position: relative;
    padding-left: var(--spacing-md);
}

.item-standard .item-content::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 3rem;
    font-family: Georgia, serif;
    color: rgba(27, 155, 158, 0.2);
    line-height: 1;
}

/* ========================================
   TIPO: BULLETS - LISTAS CON ICONOS
   ======================================== */
.about-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.about-bullets li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.about-bullets li:last-child {
    border-bottom: none;
}

.about-bullets li:hover {
    padding-left: var(--spacing-sm);
    background: rgba(27, 155, 158, 0.03);
    border-radius: var(--radius-sm);
}

.about-bullets li i {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
    margin-top: 2px;
}

.about-bullets li span {
    flex: 1;
    color: #555;
    line-height: 1.6;
    padding-top: 4px;
}

/* ========================================
   TIPO: TEXT SLIDES - CARRUSEL DE TEXTO
   ======================================== */
.text-swiper {
    padding: var(--spacing-lg);
    background: rgba(27, 155, 158, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(27, 155, 158, 0.1);
}

.text-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    min-height: 150px;
}

.text-swiper .swiper-slide p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #555;
    font-style: italic;
    position: relative;
    padding: 0 var(--spacing-xl);
}

.text-swiper .swiper-slide p::before,
.text-swiper .swiper-slide p::after {
    content: '"';
    font-size: 3rem;
    font-family: Georgia, serif;
    color: rgba(27, 155, 158, 0.2);
    position: absolute;
    line-height: 1;
}

.text-swiper .swiper-slide p::before {
    top: -20px;
    left: 0;
}

.text-swiper .swiper-slide p::after {
    bottom: -20px;
    right: 0;
}

.text-swiper .swiper-pagination {
    position: relative;
    margin-top: var(--spacing-md);
}

.text-swiper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: var(--gates-primary);
    opacity: 0.3;
    transition: all var(--transition-fast);
}

.text-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.3);
    background: var(--gates-primary);
}

/* ========================================
   TIPO: IMAGE SLIDES - CARRUSEL DE IMÁGENES
   ======================================== */
.image-swiper {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #f8f9fa;
}

.image-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 300px;
}

.image-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-swiper .swiper-button-next,
.image-swiper .swiper-button-prev {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    color: var(--gates-primary);
}

.image-swiper .swiper-button-next:after,
.image-swiper .swiper-button-prev:after {
    font-size: 1.25rem;
    font-weight: 700;
}

.image-swiper .swiper-button-next:hover,
.image-swiper .swiper-button-prev:hover {
    background: white;
    box-shadow: var(--shadow-lg);
}

.image-swiper .swiper-pagination {
    bottom: var(--spacing-md);
}

.image-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: white;
    opacity: 0.5;
}

.image-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--gates-primary);
    width: 24px;
    border-radius: 4px;
}

/* ========================================
   BOTONES DE ACCIÓN
   ======================================== */
.item-action {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.item-action .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.item-action .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width var(--transition-normal), height var(--transition-normal);
}

.item-action .btn:hover::before {
    width: 300px;
    height: 300px;
}

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

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

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
}

/* ========================================
   MODAL - CONTENIDO EMERGENTE
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-primary);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--spacing-xl);
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 80px);
    /* Account for header */
}

/* Estilos para contenido enriquecido en modal */
.modal-content-wrapper {
    line-height: 1.8;
    color: #555;
}

.modal-content-wrapper h1,
.modal-content-wrapper h2,
.modal-content-wrapper h3,
.modal-content-wrapper h4 {
    color: var(--gates-secondary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.modal-content-wrapper h1 {
    font-size: 2rem;
}

.modal-content-wrapper h2 {
    font-size: 1.75rem;
}

.modal-content-wrapper h3 {
    font-size: 1.5rem;
}

.modal-content-wrapper h4 {
    font-size: 1.25rem;
}

.modal-content-wrapper p {
    margin-bottom: var(--spacing-md);
}

.modal-content-wrapper ul,
.modal-content-wrapper ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.modal-content-wrapper li {
    margin-bottom: var(--spacing-xs);
}

.modal-content-wrapper a {
    color: var(--gates-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--transition-fast);
}

.modal-content-wrapper a:hover {
    border-bottom-color: var(--gates-primary);
}

.modal-content-wrapper strong {
    color: var(--gates-primary);
    font-weight: 600;
}

.modal-content-wrapper em {
    font-style: italic;
    color: var(--gates-secondary);
}

.modal-body p {
    line-height: 1.8;
    color: #555;
    margin-bottom: var(--spacing-md);
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: var(--radius-md);
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--gates-primary);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--gates-primary-dark);
}

/* ========================================
   ANIMACIONES DE ENTRADA
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.about-block {
    animation: fadeInUp 0.6s ease-out backwards;
}

.about-block:nth-child(1) {
    animation-delay: 0.1s;
}

.about-block:nth-child(2) {
    animation-delay: 0.2s;
}

.about-block:nth-child(3) {
    animation-delay: 0.3s;
}

.about-block:nth-child(4) {
    animation-delay: 0.4s;
}

.about-block:nth-child(5) {
    animation-delay: 0.5s;
}

.about-block:nth-child(6) {
    animation-delay: 0.6s;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets y dispositivos medianos (2 columnas) */
@media (max-width: 992px) {
    .about-grid-modular {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    /* Si solo hay 1 bloque en tablet, ocupar todo el ancho */
    .about-grid-modular:has(.about-block:only-child) {
        grid-template-columns: 1fr;
    }

    .about-block {
        padding: var(--spacing-lg);
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Móviles (1 columna) */
@media (max-width: 768px) {
    #nosotros {
        padding: var(--spacing-xl) 0;
    }

    .about-grid-modular {
        grid-template-columns: 1fr !important;
        /* Siempre 1 columna en móviles */
        gap: var(--spacing-md);
    }

    .about-block {
        padding: var(--spacing-md);
    }

    .block-title {
        font-size: 1.25rem;
    }

    .item-title {
        font-size: 1.125rem;
    }

    .modal-container {
        max-width: 95%;
    }

    .modal-header {
        padding: var(--spacing-md);
    }

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

/* Móviles pequeños */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
        padding: 0 var(--spacing-sm);
    }

    .about-bullets li i {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .text-swiper .swiper-slide p {
        font-size: 1rem;
        padding: 0 var(--spacing-md);
    }

    .item-action .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   ESTADOS Y UTILIDADES
   ======================================== */

/* Estado de carga */
.about-block.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.about-block.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(27, 155, 158, 0.2);
    border-top-color: var(--gates-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Estado vacío */
.about-block.empty {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .about-block {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .item-action {
        display: none;
    }
}