@import url('https://fonts.googleapis.com/css?family=Titillium Web');

/* assets/css/styles.css */
:root {
    --primary-color: #549db4;
    --primaryaltern-color: #306372;
    --secondary-color: #fd1100b0;
    --secondaryaltern-color: #b61105b0;
    --accent-color: #ffffff;
    --info-color: #0084ff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 0.5rem;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-image: url('../../../assets/img/hero-bg-light.webp');
    font-family: 'Titillium Web', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;

    background-size: cover;

    /* Centra la imagen */
    background-position: center center;

    /* Evita que la imagen se repita */
    background-repeat: no-repeat;

    /* Fija la imagen para que no se mueva al hacer scroll */
    background-attachment: fixed;

    /* Asegura que el fondo cubra todo el viewport */
    min-height: 100vh;

}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    /* Capa blanca semitransparente */
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.842);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 1.7em;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.13);
}

.header p {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: currentColor;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-primary {
    color: #3498db;
}

.card-success {
    color: #2ecc71;
}

.card-info {
    color: #9b59b6;
}

.card-warning {
    color: #f39c12;
}

.card-icon {
    font-size: 3em;
    opacity: 0.8;
    margin-left: 20px;
}

.card-content h3 {
    font-size: 1em;
    margin-bottom: 5px;
    color: #666;
}

.card-number {
    font-size: 2em;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.card-content p {
    color: #999;
    font-size: 0.9em;
}

/* Filtros */
.filters-section {
    margin-bottom: 30px;
}

.filters-container {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 200px;
    transition: border-color 0.3s ease;
}

.filter-group select:focus {
    border-color: #3498db;
    outline: none;
}

.btn-filtrar {
    padding: 12px 25px;
    background: white;
    border: solid 1px var(--primary-color);
    color: var(--primaryaltern-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.3s ease;
    height: fit-content;
}

.btn-filtrar:hover {
    background: var(--primary-color);
    border: solid 1px var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Charts */
.charts-container {

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
    margin-left: 30px;
    margin-right: 30px;
}

.chart-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;

}

.chart-header {
    padding: 8px 25px;
    background-color: var(--primary-color);
    color: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;

}

.chart-header h3 {
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 500;
}

.canvas {
    margin-top: 20px;
    padding: 20px;
    background-color: #0084ff;
    width: 80%;
    height: 80%;
}

.chart-content {
    background-color: #ffffff;
    height: 300px;
    position: relative;
    padding: 20px;

}

/* Tabla */
.table-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
    margin-left: 30px;
    margin-right: 30px;
}

.table-header {
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 500;
}

.btn-export {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: solid 1px #dae0dc;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.3s ease;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.322);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: normal;
    background-color: var(--primaryaltern-color);
    color: white;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
    font-weight: normal;
    font-size: 1em;
}

.data-table tr:hover {
    background: #f8f9fa;
}

/* Sección de items */
.items-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 30px;

}

.items-header {
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items-header h3 {
    font-size: 1.2em;
    color: #ffffff;
    font-weight: 500;
}

.select-aspecto {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    min-width: 250px;
}

.select-aspecto:focus{
    border-color: #3498db;
    outline: none;
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.1);

}

.items-chart {
    padding: 25px;
    height: 500px;
    position: relative;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    text-align: center;
    color: white;
}

.spinner i {
    font-size: 3em;
    margin-bottom: 20px;
}

.spinner p {
    font-size: 1.2em;
}

/* Badges de niveles */
.badge {
    display: flex;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8em;
    color: white;
    font-weight: normal;
    background-color: var(--info-color);
    width: 5em;
}

.badge-pre-inicio {
    background: #dc354667;
    color: rgb(0, 0, 0);
    font-size: 0.8em;
    font-weight: normal;
    width: 4em;

}

.badge-inicio {
    background: #fd7d146c;
    color: #000000;
    width: 4em;
}

.badge-proceso {
    background: #ffd14563;
    color: #000000;
    width: 4em;
}

.badge-logrado {
    background: #28a7465b;
    color: #000000;
    width: 4em;
}

.badge-si {
    background: #7100da65;
    color: rgb(0, 0, 0);
    width: 4em;
}

.badge-no {
    background: #f100dd6c;
    color: rgb(0, 0, 0);
    width: 4em;
}

/* Progress bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select {
        min-width: 100%;
    }

    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .items-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* Botón de regreso */
.back-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primaryaltern-color);
    color: rgb(26, 42, 112);
    padding: 1rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    font-size: 1em;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);
}

/* Efectos adicionales */
.floating {
    animation: floating 3s ease-in-out infinite;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* ===================== TOASTS ===================== */
#toastContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
  max-width: 350px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  animation: slideIn 0.4s ease, fadeOut 0.5s ease 3.5s forwards;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.toast i {
  font-size: 18px;
}

.toast.info {
  background: #c1e2fd;
  border: solid 1px #42a5f5;
  color: #066abd
}

.toast.success {
  background: #deffec;
  border: solid 1px #43d17d;
  color: #12773c;
}

.toast.error {
  background:  #ffd2d6;
  Border: solid 1px #dc3545;
  color:  #a81120;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}



/* Asegurar canvas ajuste a su contenedor */
.chart-content,
.items-chart,
.chart-content.chart-content-large {
    min-height: 300px;
    height: 300px;
}

canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 400px;
    /* Ajusta según tu layout */
}


/* Botón de regreso */
.back-button {
    position: fixed;

    padding: 0;
    width: 1.5em;
    height: 1.5em;
    bottom: 5rem;
    right: 2rem;
    background-color: var(--primaryaltern-color);
    color: white;
    font-size: 2rem;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.4);

}