@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

:root {
    /* Colores */
    --text-light: white;
    --bg-light: #f4f8fc;
    --border-light: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    
    /* Tamaños */
    --top-bar-height: 50px; 
    --footer-height: 40px; 
    
    /* Colores temáticos */
    --green: #34a853;
    --primary-dark: #0a0550;
    --primary: #140A9A;
    --primary-light: #1F14B3;
    --primary-lighter: #2A1FCC;
    --cos-dark: #000000;
    --cos: #DA291C;
    --cos-light: #DA291C;
    --cos-lighter:#000000;
    --reporte-dark: #4285f4;
    --reporte: #3c9ae0;
    --reporte-light: #2fb678;
    --reporte-lighter:#2e8c45;
    
    /* Transiciones */
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
    
    /* Gradientes */
    --gradient-header: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    --gradient-animated: linear-gradient(135deg, 
      var(--primary-dark) 0%, 
      var(--primary) 25%,
      var(--primary-light) 50%,
      var(--primary) 75%,
      var(--primary-dark) 100%);
    
    --gradient-animated-cos: linear-gradient(135deg, 
      var(--cos-dark) 0%, 
      var(--cos) 25%, 
      var(--cos-light) 50%,
      var(--cos-lighter) 75%,
      var(--cos-dark) 100%);

    --gradient-animated-reporte: linear-gradient(135deg, 
      var(--reporte-dark) 0%, 
      var(--reporte) 25%, 
      var(--reporte-light) 50%,
      var(--reporte-lighter) 75%,
      var(--reporte-dark) 100%);
      
    /* Fuente */
    --font-family: 'calibri';
    color: rgb(15,20,154);
}

/* Keyframes para animaciones */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradientAnimationSidebar {
    0% { background-position: 0% 0%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes float-content {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { top: -300px; opacity: 0; }
    to { top: 0; opacity: 1; }
}

/* Reset y estilos base */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: var(--font-family);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-light);
    color: var(--primary);
    position: relative;
}

/* Tipografía */
h1, h2 {
    font-weight: 700;
}

h2 {
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    position: relative;
    z-index: 1;
}

/* Sobreescribir color para h2 en la barra superior */
.top-bar h2, 
.sidebar h2 {
    color: white;
}

h3, h4, h5, .chart-title {
    font-weight: 500;
    color: var(--primary);
}

h3 {
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h3:before, h3:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(to right, var(--primary), transparent);
}

/* Estilos específicos para h3 según sección */
#cos-section h3 {
    color: var(--cos);
}

#cos-section h3:before, 
#cos-section h3:after {
    background: linear-gradient(to right, var(--cos), transparent);
}

#reporte-section h3 {
    color: var(--reporte-light);
}

#reporte-section h3:before, 
#reporte-section h3:after {
    background: linear-gradient(to right, var(--reporte-light), transparent);
}

p, .menu-item, input, button, textarea, select {
    font-weight: 400;
}

p {
    color: rgb(15,20,154) !important; 
}

/* =======================================================
   Estructura Principal
======================================================= */

.container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--top-bar-height) - var(--footer-height));
    overflow: hidden;
    padding: 0;
    flex: 1;
}

.content {
    padding: 20px;
    transition: var(--transition-normal);
}

.content.sidebar-open {
    margin-left: 250px;
    width: calc(100% - 250px);
}

/* =======================================================
   Barra Superior
======================================================= */

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-light);
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    z-index: 15;
    width: 100%;
    top: 0;
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientAnimation 5s ease infinite;
}

.top-bar-left {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 32px;
    margin-right: 15px;
    position: relative;
}

.header-logo::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -7px;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background-color: white;
    opacity: 0.8;
}

.vertical-separator {
    height: 24px;
    width: 1px;
    background-color: white;
    opacity: 0.8;
    margin: 0 15px;
}

.header-title {
    margin-left: 15px;
}

/* =======================================================
   Botones de Acceso Rápido
======================================================= */

.quick-access {
    display: flex;
    gap: 10px;
}

.quick-btn {
    background-color: var(--primary-lighter);
    color: var(--text-light);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    position: relative;
}

.quick-btn i { 
    margin-right: 5px; 
}

.quick-btn:hover { 
    background-color: var(--primary-light); 
}

.tooltip {
    position: absolute;
    bottom: -285%;
    right: 0;
    background-color: var(--primary);
    color: var(--text-light);
    padding: 10px;
    border-radius: 5px;
    width: 300px;
    font-size: 0.8em;
    display: none;
    z-index: 20;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.quick-btn:hover .tooltip { 
    display: block; 
}

/* =======================================================
   Sidebar
======================================================= */

.sidebar {
    width: 250px;
    color: var(--text-light);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    position: fixed;
    z-index: 10;
    top: var(--top-bar-height);
    bottom: var(--footer-height);
    left: 0;
    overflow-y: auto;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - var(--top-bar-height) - var(--footer-height));
    background: var(--gradient-animated);
    background-size: 200% 210%;
    animation: gradientAnimation 5s ease infinite;
}

.sidebar h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--text-light);
}

.sidebar.collapsed { 
    transform: translateX(-100%); 
}

.menu-item {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
}

.menu-item:hover { 
    background-color: yellow;
    transform: translateX(5px);
}

.menu-item.active { 
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: -4px 0 0 white;
}

.menu-item i { 
    margin-right: 10px; 
}

.submenu {
    display: none;
    margin-left: 15px;
    padding-left: 10px;
    border-left: 2px solid var(--primary-light);
}

.submenu .menu-item {
    padding: 8px;
    font-size: 0.9em;
}

/* =======================================================
   Navegación Horizontal
======================================================= */

.horizontal-nav {
    width: 100%;
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientAnimation 5s ease infinite;
    color: var(--text-light);
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    z-index: 9;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    padding: 0 20px;
}

.nav-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.horizontal-nav .menu-item {
    position: relative;
    padding: 12px 15px;
    margin: 0 2px;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: var(--transition-normal);
}

.horizontal-nav .menu-item i {
    margin-right: 8px;
}

.horizontal-nav .menu-item .fa-caret-down {
    margin-left: 5px;
    margin-right: 0;
}

.horizontal-nav .menu-item:hover {
    background-color: rgb(255,200,47);
}

.horizontal-nav .menu-item.active {
    background-color: var(--primary-lighter);
}

.horizontal-nav .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary);
    min-width: 240px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 5px 5px;
    z-index: 10;
    display: none;
    padding: 5px;
    background-color: white;
    color: black;
}

.horizontal-nav .submenu .menu-item {
    display: block;
    width: 100%;
}

/* =======================================================
   Footer
======================================================= */

.footer {
    text-align: center;
    padding: 10px;
    color: var(--text-light);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 100;
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-animated);
    background-size: 400% 400%;
    animation: gradientAnimation 5s ease infinite;
}

#clocks {
    display: inline-block;
    margin-left: 15px;
}

#clocks span {
    margin-left: 15px;
    font-size: 0.9em;
}

.footer-logo {
    display: none;
}

/* =======================================================
   Contenedores de Contenido y Secciones de Gráficos
======================================================= */

#charts-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    height: auto;
    padding: 20px;
    padding-bottom: var(--footer-height);
}

.charts {
    height: calc(100% - 40px);
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Fondos de sección */
#mision-section::before,
#vision-section::before,
#proposito-section::before,
#valores-section::before,
#resultados-section::before,
#cos-section::before,
#kway-section::before,
#sqldc-section::before,
#reporte-section::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -1;
}

/* Contenedores de texto de sección */
.section-text,
#proposito-section .section-text,
#valores-section .section-text,
#cos-section .section-text,
#kway-section .section-text,
#sqldc-section .section-text {
    padding-top: 15px;
    overflow: visible;
    animation: float-content 5s ease-in-out infinite !important;
}

.text-image-section {
    padding: 0;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Paginación */
.page-indicator {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.nav-button {
    position: fixed;
    top: 50%;
    z-index: 100;
}

/* =======================================================
   Tarjetas y Animaciones
======================================================= */

/* Estilos comunes de tarjetas */
.chart-box, 
.valor-card, 
.resultado-card, 
.cos-card, 
.sqldc-card {
    height: auto !important;
    min-height: auto !important;
    margin-bottom: 30px;
}

/* Aplicar animación flotante a elementos de tarjeta */
.valor-card, 
.resultado-card, 
.pilar-item, 
.pilar-kway, 
.chart-box, 
.prioridad-card,
.kpi-card,
.komatsu-card {
    animation: float 5s ease-in-out infinite;
}

/* Retrasos de animación escalonados */
.valor-card:nth-child(1),
.resultado-card:nth-child(1),
.pilar-item:nth-child(1),
.pilar-kway:nth-child(1),
.chart-box:nth-child(1),
.prioridad-card:nth-child(1),
.kpi-card:nth-child(1),
.komatsu-card:nth-child(1) {
    animation-delay: 0s;
}

.valor-card:nth-child(2),
.resultado-card:nth-child(2),
.pilar-item:nth-child(2),
.pilar-kway:nth-child(2),
.chart-box:nth-child(2),
.prioridad-card:nth-child(2),
.kpi-card:nth-child(2),
.komatsu-card:nth-child(2) {
    animation-delay: 0.5s;
}

.valor-card:nth-child(3),
.resultado-card:nth-child(3),
.pilar-item:nth-child(3),
.pilar-kway:nth-child(3),
.chart-box:nth-child(3),
.prioridad-card:nth-child(3),
.kpi-card:nth-child(3),
.komatsu-card:nth-child(3) {
    animation-delay: 1s;
}

.valor-card:nth-child(4),
.resultado-card:nth-child(4),
.pilar-item:nth-child(4),
.pilar-kway:nth-child(4),
.chart-box:nth-child(4),
.prioridad-card:nth-child(4),
.kpi-card:nth-child(4),
.komatsu-card:nth-child(4) {
    animation-delay: 1.5s;
}

.valor-card:nth-child(5),
.resultado-card:nth-child(5),
.pilar-item:nth-child(5),
.pilar-kway:nth-child(5),
.chart-box:nth-child(5),
.prioridad-card:nth-child(5),
.kpi-card:nth-child(5),
.komatsu-card:nth-child(5) {
    animation-delay: 2s;
}

/* Efectos hover para tarjetas */
.valor-card:hover, 
.resultado-card:hover, 
.pilar-item:hover, 
.pilar-kway:hover, 
.chart-box:hover, 
.prioridad-card:hover,
.kpi-card:hover,
.komatsu-card:hover {
    animation-play-state: paused;
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

/* =======================================================
   Tarjetas Komatsu
======================================================= */

.komatsu-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    border-top: 5px solid rgb(15,20,154);
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.komatsu-card-header {
    background-color: #f8f9fa;
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.komatsu-card-icon {
    margin-right: 15px;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background-color: rgb(15,20,154);
}

.komatsu-card-title {
    font-size: 20px;
    font-weight: 500;
    color: rgb(15,20,154);
}

.komatsu-card-body {
    padding: 20px;
    flex: 1;
}

.komatsu-card-description {
    margin-bottom: 15px;
    color: rgb(15,20,154);
    line-height: 1.6;
}

.komatsu-card-features {
    margin-left: 20px;
    list-style-type: none;
}

.komatsu-card-features li {
    margin-bottom: 10px;
    color: #333;
    position: relative;
}

.komatsu-card-features li::before {
    content: "✓";
    position: absolute;
    left: -20px;
    color: rgb(15,20,154);
    font-weight: bold;
}

.komatsu-card-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.komatsu-card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background-color: rgba(15,20,154,0.05);
    border-radius: 8px;
}

.komatsu-card-metric-value {
    font-size: 22px;
    font-weight: bold;
    color: rgb(15,20,154);
}

.komatsu-card-metric-label {
    font-size: 12px;
    color: #555;
    margin-top: 3px;
}

.komatsu-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

/* =======================================================
   Modal
======================================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.4s;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover { 
    color: var(--primary); 
}

.modal h3 {
    margin-top: 0;
    color: var(--primary);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.contact-info { 
    margin-top: 20px; 
}

.contact-info p { 
    margin: 8px 0; 
}

.contact-info hr {
    margin: 15px 0;
    border: none;
    border-top: 1px solid #eee;
}

.contact-info i {
    color: var(--primary);
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* =======================================================
   Estilos Responsivos
======================================================= */

@media (max-width: 1200px) {
    .horizontal-nav .menu-item {
        padding: 10px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 992px) {
    .horizontal-nav {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .nav-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .content.sidebar-open {
        margin-left: 0;
        width: 100% !important;
    }
    
    .horizontal-nav {
        position: relative;
        top: 0;
    }
    
    .content {
        margin-top: var(--top-bar-height);
    }
    
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .horizontal-nav .menu-item {
        width: 100%;
    }
    
    .horizontal-nav .submenu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding-left: 15px;
    }
    
    .komatsu-cards-container {
        grid-template-columns: 1fr;
    }
}