﻿/*
 * =====================================================
 * ARCHIVO DE TEMA: spgg-theme.css
 * Contiene todas las variables de la marca
 * y estilos para componentes personalizados.
 * =====================================================
 */

/* ========================================
 * 1. VARIABLES DE LA MARCA
 * ======================================== */
:root {
    /* Paleta de Colores */
    --spgg-blue: #3F63E8;
    --spgg-blue-dark: #214394;
    --spgg-teal: #33D3B8;
    --spgg-green: #00B636;
    --spgg-red: #FF454E;
    --spgg-red-dark: #d63942;
    --spgg-orange: #FFAC70;
    --spgg-yellow: #FFC107;
    --spgg-gray: #6c757d;
    /* RGB helpers para usar rgba() sin repetir números */
    --spgg-blue-rgb: 63, 99, 232;
    --spgg-green-rgb: 0, 182, 54;
    --spgg-red-rgb: 255, 69, 78;
    --spgg-yellow-rgb: 255, 193, 7;
    
    /* Tipografía */
    --font-primary: 'Bebas Neue', sans-serif;
    --font-secondary: 'Poppins', sans-serif;
}

/* ========================================
 * 2. ESTILOS DE BOTONES
 * ======================================== */

/* Botón Primario */
.btn-spgg-primary {
    color: #fff;
    background-color: var(--spgg-blue);
    border-color: var(--spgg-blue);
    font-weight: bold;
    transition: all 0.3s;
}

.btn-spgg-primary:hover {
    color: #fff;
    background-color: var(--spgg-blue-dark);
    border-color: var(--spgg-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Botón Success */
.btn-spgg-success {
    color: #fff;
    background-color: var(--spgg-green);
    border-color: var(--spgg-green);
    font-weight: bold;
    font-family: var(--font-secondary);
    transition: all 0.3s;
}

.btn-spgg-success:hover {
    color: #fff;
    background-color: #008a2a;
    border-color: #008a2a;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* ========================================
 * 3. ESTILOS DEL ASISTENTE "SAM"
 * ======================================== */

/* Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

/* Contenedor Principal */
.tutorial-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 9999;
    max-width: 350px;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Burbuja del Tutorial */
.tutorial-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 2px solid var(--spgg-blue);
}

.tutorial-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 40px;
    border-width: 12px;
    border-style: solid;
    border-color: var(--spgg-blue) transparent transparent transparent;
}

/* Header del Tutorial */
.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    padding-right: 25px;
    border-bottom: 2px solid var(--spgg-blue);
}

.tutorial-title {
    font-weight: bold;
    color: var(--spgg-blue-dark);
    font-size: 16px;
    flex: 1;
    margin-right: 10px;
}

.tutorial-step-counter {
    background-color: var(--spgg-blue);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

/* Contenido del Tutorial */
.tutorial-content {
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
    min-height: 60px;
    font-family: var(--font-secondary);
}

/* Navegación */
.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.tutorial-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 13px;
    font-family: var(--font-secondary);
}

.tutorial-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-btn-prev {
    background-color: var(--spgg-gray);
    color: white;
}

.tutorial-btn-prev:hover {
    background-color: #5a6268;
}

.tutorial-btn-next {
    background-color: var(--spgg-blue);
    color: white;
}

.tutorial-btn-next:hover {
    background-color: var(--spgg-blue-dark);
}

.tutorial-btn-close {
    background-color: var(--spgg-red);
    color: white;
}

.tutorial-btn-close:hover {
    background-color: var(--spgg-red-dark);
}

/* Imagen del Asistente */
.tutorial-assistant-img {
    width: 120px;
    height: 120px;
    display: block;
    margin-left: auto;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--spgg-blue);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Puntos de Navegación */
.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
}

.tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
    transition: all 0.3s;
}

.tutorial-dot.active {
    background-color: var(--spgg-blue);
    width: 20px;
    border-radius: 4px;
}

/* Highlight */
.tutorial-highlight {
    outline: 3px solid var(--spgg-blue);
    outline-offset: 3px;
    background-color: rgba(63, 99, 232, 0.1);
    transition: all 0.3s;
    position: relative;
    z-index: 9997;
}

/* Ícono de Cierre */
.tutorial-close-icon {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    color: var(--spgg-red);
    transition: all 0.3s;
}

.tutorial-close-icon:hover {
    transform: scale(1.2);
    color: var(--spgg-red-dark);
}

/* Media Query para SAM */
@media (max-width: 768px) {
    .tutorial-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .tutorial-assistant-img {
        width: 80px;
        height: 80px;
    }
}


/* ========================================
 * 4. ESTILOS DEL HEADER
 * ======================================== */

.top-bar {
    height: 6px;
    background-color: var(--spgg-blue);
}

.main-header {
    background-color: #fff;
}

.navbar {
    background-color: #fff !important;
    border-bottom: 1px solid #dee2e6;
}

.navbar-brand-text {
    color: var(--spgg-blue-dark);
    font-family: var(--font-primary);
    text-decoration: none;
}

.navbar-brand-text:hover {
    color: var(--spgg-blue);
    text-decoration: none;
}

/* ========================================
 * 5. ESTILOS DEL FOOTER
 * ======================================== */

/* Prevenir scroll horizontal */
body {
    overflow-x: hidden;
}

/* Footer Base */
footer {
    background-color: #113CA5;
    width: 100%;
    overflow-x: hidden;
    position: relative;
    line-height: normal;
}

footer h5 {
    margin-bottom: 20px;
    color: white;
    font-family: var(--font-secondary);
    font-size: 18px;
    line-height: 20px;
}

/* Wrapper Footer */
.wrapper-footer {
    border-bottom: 1px solid rgba(194, 222, 255, .4);
}

/* Sección Un Solo San Pedro */
.content-unsolospgg {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--spgg-orange);
    align-self: stretch;
    padding: 20px;
    min-height: 300px;
}

@media (min-width: 768px) {
    .content-unsolospgg {
        justify-content: flex-start;
    }
}

.content-unsolospgg img {
    max-width: 125px !important;
    height: auto;
}

/* Logo del Footer */
.text-logo-footer {
    margin: 0 auto;
    max-width: 350px;
    height: auto;
    width: 100%;
}

/* Texto del Footer */
.footer-text {
    color: #fff;
    font-size: 16px;
    line-height: 1.8;
}

.footer-link {
    text-decoration: none;
    color: #fff;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 18px;
}

.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

#direccion {
    padding-left: 0;
}

/* ========================================
 * 6. REDES SOCIALES
 * ======================================== */

.social-networks {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
}

.social-networks a {
    color: #fff;
    transition: all 0.3s;
    display: inline-flex;
    text-decoration: none;
}

.social-networks a:hover {
    transform: scale(1.1);
    text-decoration: none;
}

.social-networks .dfLhle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.social-networks .dfLhle:hover {
    background-color: var(--spgg-orange);
}

.social-networks .dfLhle i {
    font-size: 24px;
    color: #fff;
}

/* ========================================
 * 8. UTILIDADES DE COLOR (Reutilizables)
 * ======================================== */
.bg-spgg-blue { background-color: var(--spgg-blue); }
.bg-spgg-green { background-color: var(--spgg-green); }
.bg-spgg-red { background-color: var(--spgg-red); }
.bg-spgg-yellow { background-color: var(--spgg-yellow); }

.text-spgg-blue { color: var(--spgg-blue) !important; }
.text-spgg-green { color: var(--spgg-green) !important; }
.text-spgg-red { color: var(--spgg-red) !important; }
.text-spgg-yellow { color: var(--spgg-yellow) !important; }

.btn-spgg-danger {
    color: #fff;
    background-color: var(--spgg-red);
    border-color: var(--spgg-red);
    font-weight: bold;
}
.btn-spgg-danger:hover {
    background-color: var(--spgg-red-dark);
    border-color: var(--spgg-red-dark);
}

/* Thead helpers for admin tables */
.thead-spgg-blue {
    background-color: var(--spgg-blue);
    color: #fff;
}
.thead-spgg-red {
    background-color: var(--spgg-red);
    color: #fff;
}

/* ========================================
 * 9. COMPONENTES PERSONALIZADOS
 * ======================================== */

/* Tarjeta de estadística (stat-card) */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 6px 18px rgba(14, 30, 70, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(14, 30, 70, 0.09);
}

/* Ícono dentro de la tarjeta */
.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(14, 30, 70, 0.06);
}

/* Badges 'soft' — fondo pastel + texto oscuro */
.badge-soft {
    display: inline-block;
    padding: .35rem .6rem;
    font-size: .85rem;
    font-weight: 600;
    border-radius: .45rem;
    color: #1f2937; /* texto oscuro */
}

.badge-soft-success { background-color: rgba(0, 182, 54, 0.12); }
.badge-soft-danger { background-color: rgba(255, 69, 78, 0.12); }
.badge-soft-warning { background-color: rgba(255, 193, 7, 0.12); }
.badge-soft-info { background-color: rgba(51, 211, 184, 0.12); }
.badge-soft-primary { background-color: rgba(63, 99, 232, 0.12); }

/* Tabla personalizada */
.table-custom thead { background-color: var(--spgg-blue); color: #fff; }
.table-custom thead th { color: #fff; border-color: rgba(255,255,255,0.06); }
.table-custom tbody tr:hover { background-color: rgba(var(--spgg-blue-rgb), 0.04); }
.table-custom { background-color: rgba(var(--spgg-blue-rgb), 0.03); border-radius: 8px; overflow: hidden; }
.table-custom th, .table-custom td { vertical-align: middle; }

/* Sidebar principal para el portal público */
.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, var(--spgg-blue-dark), var(--spgg-blue));
    color: white;
    z-index: 1050;
    padding-top: 2.5rem;
}

.site-sidebar a {
    color: rgba(255,255,255,0.95);
    display: block;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
}

.site-sidebar .logo { text-align: center; margin-bottom: 1rem; }

.site-sidebar .logo img { max-width: 180px; }

.site-main { margin-left: 260px; }

@media (max-width: 991px) {
    .site-sidebar { transform: translateX(-100%); transition: transform .25s ease; }
    .site-main { margin-left: 0; }
    .site-sidebar.show { transform: translateX(0); }
}

/* ========================================
 * 10. LAYOUT ADMINISTRATIVO
 * ======================================== */

 
/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: linear-gradient(180deg, var(--spgg-blue-dark) 0%, var(--spgg-blue) 100%);
    color: #fff;
    z-index: 1040;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header img {
    max-height: 50px;
    filter: brightness(0) invert(1); /* Logo blanco */
}

.sidebar-menu {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    border-left-color: var(--spgg-teal);
}

.sidebar-menu a i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    background-color: rgba(0,0,0,0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--spgg-teal);
    color: var(--spgg-blue-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Topbar */
.admin-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 260px;
    height: 70px;
    background-color: #fff;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

/* Content */
.admin-content {
    margin-left: 260px;
    padding: 90px 2rem 2rem 2rem; /* Top padding > topbar height */
    min-height: 100vh;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
    }
    
    .admin-topbar {
        left: 0;
    }
    
    .admin-content {
        margin-left: 0;
    }
}

@media (max-width: 991px) {
    .content-unsolospgg {
        padding: 30px 20px;
    }

    .text-logo-footer {
        max-width: 250px;
    }

    footer h5 {
        margin-bottom: 15px;
        text-align: center;
    }

    #informacion,
    #direccion {
        text-align: center;
    }

    .wrapper-footer .col-md-4 div,
    .wrapper-footer .col-md-5 div {
        text-align: center;
    }

    .social-networks {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    footer h5 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .footer-text,
    .footer-link {
        font-size: 14px;
    }

    #direccion li {
        font-size: 12px;
    }

    .text-logo-footer {
        max-width: 200px;
    }

    .content-unsolospgg img {
        max-width: 100px;
    }
}

.alert-side {
    border-left: 6px solid var(--spgg-blue);
    background: #fff;
    color: #1f2937;
    box-shadow: 0 6px 18px rgba(14, 30, 70, 0.03);
}