/**
 * INSTITUCIÓN EDUCATIVA EL CASTILLO
 * Estilos Personalizados - custom.css
 * Componentes y Estilos Específicos del Sitio
 */

/* ========== COLOR UTILITIES ========== */
/* Clase personalizada para usar el color primario del tema */
.text-brand-primary {
    color: var(--primary-color) !important;
}

/* Sobrescribir text-primary de Bootstrap en navbar y headers */
.navbar-brand .text-primary,
.dropdown-header.text-primary {
    color: var(--primary-color) !important;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    background: none;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========== NAVBAR STYLES ========== */
.navbar.fixed-top {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    padding: 0.75rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

.navbar-brand {
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-1px);
}

.navbar-nav .nav-link {
    position: relative;
    font-weight: 500;
    color: #495057 !important;
    margin: 0 0.2rem;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: rgba(0, 125, 0, 0.05);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    background-color: rgba(0, 125, 0, 0.1);
    font-weight: 600;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 80%;
}

.dropdown-menu {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    margin-top: 0.5rem;
    padding: 1rem 0;
    min-width: 280px;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    border-radius: 8px;
    margin: 0 0.5rem;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 125, 0, 0.05) 0%, rgba(136, 212, 152, 0.05) 100%);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-divider {
    margin: 0.75rem 0;
    opacity: 0.1;
}

/* Light mode - Navbar icons and brand */
.light-mode .navbar-brand {
    color: #007D00 !important;
}

.light-mode .navbar-brand .text-primary {
    color: #007D00 !important;
}

.light-mode .navbar-brand i {
    color: #007D00 !important;
}

.light-mode .dropdown-header {
    color: #007D00 !important;
}

.light-mode .dropdown-header.text-primary {
    color: #007D00 !important;
}

/* Dark mode - Navbar */
.dark-mode .navbar,
.dark-mode .navbar.fixed-top {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%) !important;
    border-bottom-color: rgba(136, 212, 152, 0.15);
}

.dark-mode .navbar-nav .nav-link {
    color: #e6edf3 !important;
}

.dark-mode .navbar-nav .nav-link:hover {
    color: #3fb950 !important;
    background-color: rgba(63, 185, 80, 0.1);
}

.dark-mode .navbar-nav .nav-link.active {
    color: #3fb950 !important;
    background-color: rgba(63, 185, 80, 0.15);
}

.dark-mode .dropdown-menu {
    background-color: #161b22;
    border-color: rgba(136, 212, 152, 0.15);
}

.dark-mode .dropdown-item {
    color: #e6edf3;
}

.dark-mode .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.1) 0%, rgba(46, 160, 67, 0.1) 100%);
    color: #3fb950;
}

.dark-mode .dropdown-divider {
    border-color: rgba(136, 212, 152, 0.15);
}

/* Dark mode - Icons and brand */
.dark-mode .navbar-brand {
    color: #fbbf24 !important;
}

.dark-mode .navbar-brand .text-primary {
    color: #fbbf24 !important;
}

.dark-mode .navbar-brand i {
    color: #fbbf24 !important;
}

.dark-mode .dropdown-item i,
.dark-mode .dropdown-item .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.dark-mode .dropdown-item:hover i {
    color: #3fb950 !important;
}

.dark-mode .dropdown-header {
    color: #fbbf24 !important;
}

.dark-mode .dropdown-header.text-primary {
    color: #fbbf24 !important;
}

/* Dark mode - Navbar toggler */
.dark-mode .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========== PAGE HEADER ========== */
.page-header {
    background: #007d00;
    color: white;
    padding: 3rem 0 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/patterns/patron4.webp');
    background-repeat: repeat-x;
    background-size: 300px 260px;
    opacity: 0.5;
    background-position: top left;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    display: inline-flex;
}

.breadcrumb-item {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.6);
    content: "›";
    font-size: 1.2rem;
}

.dark-mode .page-header {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    min-height: calc(100vh - 400px);
    background-color: var(--bg-primary);
}

section {
    background-color: var(--bg-primary);
}

.content-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    margin-bottom: 2rem;
}

.content-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.content-card h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.content-card h3 {
    color: var(--text-primary);
    font-size: 1.35rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.content-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.content-card ul,
.content-card ol {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content-card li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.content-card li::marker {
    color: var(--primary-color);
}

/* Info boxes */
.info-box {
    background: linear-gradient(135deg, rgba(0, 125, 0, 0.05) 0%, rgba(136, 212, 152, 0.05) 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.info-box i {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 1rem;
}

.dark-mode .info-box {
    background: linear-gradient(135deg, rgba(63, 185, 80, 0.1) 0%, rgba(46, 160, 67, 0.1) 100%);
}

/* ========== BUTTONS ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 125, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 125, 0, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ========== FOOTER ========== */
.footer {
    background: #007D00;
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.footer h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer li {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
}

.footer strong {
    color: white;
    font-weight: 700;
}

.footer-copyright {
    background-color: rgba(0, 0, 0, 0.15);
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-copyright a {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 600;
}

.footer-copyright a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

.dark-mode .footer {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
}

.dark-mode .footer-copyright {
    background-color: rgba(0, 0, 0, 0.3);
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* ========== SCROLL TO TOP BUTTON ========== */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 125, 0, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 125, 0, 0.4);
}

/* ========== MULTI-LEVEL DROPDOWN SUBMENU ========== */
/* Estilos para submenús multinivel (dropdown dentro de dropdown) */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
    margin-left: -1px;
}

/* Submenú alineado a la izquierda cuando se sale del borde derecho */
.dropdown-submenu.dropstart > .dropdown-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: -1px;
}

/* Indicador visual de que hay un submenú */
.dropdown-submenu > .dropdown-item::after {
    content: "\f054"; /* Font Awesome chevron-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 1rem;
    transition: all 0.3s ease;
}

/* Cambiar el indicador cuando el submenú se abre a la izquierda */
.dropdown-submenu.dropstart > .dropdown-item::after {
    content: "\f053"; /* Font Awesome chevron-left */
    left: 1rem;
    right: auto;
}

.dropdown-submenu:hover > .dropdown-item::after {
    transform: translateX(3px);
}

.dropdown-submenu.dropstart:hover > .dropdown-item::after {
    transform: translateX(-3px);
}

/* Mostrar el submenú al hacer hover */
.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Dark mode para submenús */
.dark-mode .dropdown-submenu > .dropdown-menu {
    background-color: #161b22;
    border-color: rgba(136, 212, 152, 0.15);
}

/* Responsive: En móvil, mostrar los submenús uno debajo del otro */
@media (max-width: 991px) {
    .dropdown-submenu > .dropdown-menu {
        position: relative;
        left: 0;
        margin-left: 1rem;
        margin-top: 0.5rem;
        box-shadow: none;
        border-left: 2px solid var(--primary-color);
    }

    .dropdown-submenu > .dropdown-item::after {
        content: "\f078"; /* Font Awesome chevron-down */
    }

    .dropdown-submenu > .dropdown-menu {
        display: none;
    }

    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.75rem;
    }

    .content-card {
        padding: 1.5rem;
    }

    .footer {
        padding: 2rem 0 1rem;
    }
}
