/* ================================================
   ESCUELA WEBSITE - MAIN STYLES (ARREGLADO)
   ================================================ */

/* CSS Variables for easy maintenance */
:root {
    --primary-color: #1B3840;
    --accent-color: #D0AF4F;
    --text-light: #ffffff;
    --text-dark: #333333;
    --background-light: #f8f8f8;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.3s ease;
    --sidebar-width: 70px;
    --sidebar-expanded-width: 280px;
}

/* ================================================
   RESET & BASE STYLES
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

/* Ocultar scroll solo en página de inicio */
body.home-page {
    overflow: hidden;
    height: 100vh;
}

body.home-page .main-content {
    overflow: hidden;
}

/* ================================================
   SIDEBAR NAVIGATION - COMPORTAMIENTO ARREGLADO
   ================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    z-index: 1000;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

/* DESKTOP: Hover para expandir sidebar */
.sidebar:hover {
    width: var(--sidebar-expanded-width);
}

.sidebar:hover .sidebar-menu {
    overflow-y: auto;
}

.sidebar:hover .menu-item:hover .submenu {
    max-height: 400px;
}

.sidebar:hover .scrollable-submenu:hover {
    max-height: 300px;
}

.sidebar:hover .scrollable-submenu:hover .submenu-scroll {
    max-height: 300px;
}

.sidebar-header {
    padding: 5px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}


.home-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: var(--transition-smooth);
    width: 60px; /* Ancho del logo por defecto */
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Logo centrado y más grande cuando sidebar está expandido */
.sidebar:hover .home-button {
    width: 80px;
    height: 80px;
    margin: 0 0;
    align-items: center;
}

.sidebar:hover .sidebar-header {
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-button:hover {
    transform: scale(1.5);
}

.home-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.sidebar-menu {
    padding: 20px 0;
    list-style: none;
    height: 100%;
    overflow: hidden; /* Por defecto oculto */
    overflow-x: hidden;
}

/* Personalizar scrollbar del menú */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 2px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.menu-item {
    position: relative;
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 15px 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition-smooth);
    white-space: nowrap;
    position: relative;
}

.menu-link:hover {
    background-color: rgba(255, 215, 0, 0.1);
    color: var(--accent-color);
}

.menu-link.active {
    background-color: rgba(255, 215, 0, 0.2);
    color: var(--accent-color);
}

.menu-icon {
    min-width: 40px;
    font-size: 18px;
    text-align: center;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}


.menu-text {
    margin-left: 15px;
    font-weight: 500;
    flex: 1;
}

.submenu-arrow {
    font-size: 12px;
    transition: var(--transition-smooth);
    margin-left: auto;
    opacity: 0;
}

.sidebar:hover .submenu-arrow {
    opacity: 1;
}

.menu-item.expanded .submenu-arrow {
    transform: rotate(180deg);
}

/* ================================================
   SUBMENU MEJORADO - COMPORTAMIENTO ARREGLADO
   ================================================ */

.submenu {
    background-color: rgba(0, 0, 0, 0.3);
    max-height: 0 !important; /* INICIAR CONTRAÍDO */
    overflow: hidden;
    transition: max-height 0.4s ease;
}

/* DESKTOP: Expandir en hover */
.menu-item:hover .submenu{
    max-height: 400px;
}

/* Submenu scrollable para servicios */
.scrollable-submenu {
    max-height: 0; /* INICIAR CONTRAÍDO */
}

.scrollable-submenu .submenu-scroll {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.scrollable-submenu .submenu-scroll::-webkit-scrollbar {
    width: 3px;
}

.scrollable-submenu .submenu-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.scrollable-submenu .submenu-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 215, 0, 0.3);
    color: var(--accent-color);    
    border-radius: 1px;
}

.submenu-item {
    padding: 10px 20px 10px 75px;
    color: #ccc;
    text-decoration: none;
    display: block;
    transition: var(--transition-smooth);
    font-size: 14px;
    border-left: 3px solid transparent;
}

.submenu-item:hover {
    color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.05);
    border-left-color: var(--accent-color);
}

.submenu-item.active {
    color: var(--accent-color);
    background-color: rgba(255, 215, 0, 0.1);
    border-left-color: var(--accent-color);
}

/* ================================================
   MOBILE MENU
   ================================================ */

.mobile-menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--accent-color);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.mobile-menu-toggle:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================================================
   MAIN CONTENT LAYOUT
   ================================================ */

.main-content {
    position: relative;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ================================================
   HERO SECTION & SLIDER - MEJORADO
   ================================================ */

.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
    display: grid;
    place-items: center;
}

.slider-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    pointer-events: none !important;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.slide.active {
    opacity: 1;
}

.slide.transitioning {
    opacity: 0.5;
    transition: opacity 0.4s ease-in-out;
}

.slide img {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    object-position: center center;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.slide.transitioning {
    opacity: 1;
}

.hero-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: grid;
    place-items: center;
    z-index: 2;
    pointer-events: none !important;
}

.logo-container {
    display: grid;
    place-items: center;
    z-index: 10;
    pointer-events: none;
    position: relative;
}

.logo-container,
.logo-container * {
    pointer-events: none !important;
}

.logo {
    width: min(350px, 90vw);
    height: min(350px, 90vh);
    display: grid;
    place-items: center;
    font-size: clamp(20px, 5vw, 48px);
    font-weight: bold;
    color: var(--primary-color);
    animation: pulse 3s infinite;
    position: relative;
    overflow: hidden;
}

.logo-img,
.logo-main {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    opacity: 0.25;
    pointer-events: none; 
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.05); 
    }
}

/* ================================================
   SLIDER NAVIGATION
   ================================================ */

.slider-dots {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;  /* Mayor que todo */
    pointer-events: auto;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.dot.active {
    background: var(--accent-color);
}

.dot:hover {
    background: rgba(255, 215, 0, 0.8);
    transform: scale(1.2); /* AGREGAR para feedback visual */
}

/* ================================================
   CONTENT PAGES
   ================================================ */

.page-content {
    display: none;
    padding: 40px;
    background-color: var(--background-light);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page-content.active {
    display: block;
}

.page-header {
    background: var(--text-light);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.page-title {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-subtitle {
    color: #666;
    font-size: 16px;
    font-style: italic;
}

.content-card {
    background: var(--text-light);
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.content-card h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 24px;
}

.content-card h3 {
    color: var(--primary-color);
    margin: 20px 0 10px 0;
    font-size: 20px;
}

.content-card p {
    margin-bottom: 15px;
    text-align: justify;
}

/* ================================================
   SEARCH FUNCTIONALITY
   ================================================ */

.search-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    align-items: center;
    flex-direction: row;
}

.search-input {
    padding: 10px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    background: var(--text-light);
    outline: none;
    transition: var(--transition-smooth);
    display: none;
    width: 250px;
    margin-right: 10px;
    order: 1;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.search-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-smooth);
    order: 2;
}

.search-button:hover {
    background: var(--accent-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

/* ================================================
   ACCESSIBILITY
   ================================================ */

.using-keyboard *:focus {
    outline: 2px solid var(--accent-color) !important;
    outline-offset: 2px;
}

/* ================================================
   LOADING ANIMATION
   ================================================ */

.loading {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.loaded {
    opacity: 1;
}