/* ============================================
   ESTILOS MODERNOS PARA PANELES ADMINISTRATIVOS
   Grupo Scout San Patricio N°91
   ============================================ */

/* Contenedor principal de paneles */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 200px);
}

/* Encabezados de página */
.admin-header {
    margin-bottom: 2.5rem;
}

.admin-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--scout-text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.admin-subtitle {
    font-size: 1.125rem;
    color: var(--scout-text-secondary);
    font-weight: 400;
}

/* Barra de herramientas superior */
.admin-toolbar {
    background: var(--scout-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.toolbar-section {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.toolbar-section.main {
    flex: 1;
    min-width: 300px;
}

.toolbar-section.actions {
    margin-left: auto;
}

/* Selectores y filtros modernos */
.modern-select, .modern-input {
    padding: 0.625rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--scout-text-primary);
    background: var(--scout-white);
    transition: all 0.2s ease;
    min-width: 180px;
}

.modern-select:hover, .modern-input:hover {
    border-color: var(--scout-green-accent);
}

.modern-select:focus, .modern-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Grupo de búsqueda */
.search-group {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 500px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--scout-text-primary);
    background: var(--scout-white);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.search-input::placeholder {
    color: var(--gray-500);
}

/* Botones modernos */
.btn-modern {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.5;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-modern:active {
    transform: translateY(0);
}

.btn-modern-primary {
    background: var(--color-primary);
    color: white;
}

.btn-modern-primary:hover {
    background: var(--color-primary-dark);
    color: white;
}

.btn-modern-secondary {
    background: var(--gray-200);
    color: var(--scout-text-primary);
}

.btn-modern-secondary:hover {
    background: var(--gray-300);
    color: var(--scout-text-primary);
}

.btn-modern-success {
    background: var(--scout-green-primary);
    color: white;
}

.btn-modern-success:hover {
    background: var(--scout-green-light);
    color: white;
}

.btn-modern-warning {
    background: var(--scout-gold-primary);
    color: var(--scout-text-primary);
}

.btn-modern-warning:hover {
    background: var(--scout-gold-dark);
}

.btn-modern-danger {
    background: var(--scout-red-primary);
    color: white;
}

.btn-modern-danger:hover {
    background: var(--scout-red-dark);
    color: white;
}

.btn-modern-info {
    background: #039BE5;
    color: white;
}

.btn-modern-info:hover {
    background: #0288D1;
    color: white;
}

.btn-modern-outline {
    background: transparent;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-modern-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-modern-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
}

.btn-modern-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Iconos en botones */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
}

/* Tabla moderna */
.modern-table-container {
    background: var(--scout-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
}

.modern-table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.modern-table thead th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--scout-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modern-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.15s ease;
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody tr:hover {
    background: var(--gray-50);
}

.modern-table tbody td {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    color: var(--scout-text-primary);
    vertical-align: middle;
}

/* Badges/Estado */
.badge-modern {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.badge-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--scout-green-primary);
}

.badge-warning {
    background: rgba(251, 192, 45, 0.15);
    color: #F57C00;
}

.badge-danger {
    background: rgba(198, 40, 40, 0.1);
    color: var(--scout-red-primary);
}

.badge-info {
    background: rgba(3, 155, 229, 0.1);
    color: #0277BD;
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--scout-text-secondary);
}

/* Formularios modernos */
.modern-form {
    background: var(--scout-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--scout-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--scout-text-primary);
    margin-bottom: 0.5rem;
}

.form-label-required::after {
    content: " *";
    color: var(--scout-red-primary);
}

.form-control-modern {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--scout-text-primary);
    background: var(--scout-white);
    transition: all 0.2s ease;
}

.form-control-modern:hover {
    border-color: var(--scout-green-accent);
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.form-control-modern::placeholder {
    color: var(--gray-500);
}

textarea.form-control-modern {
    resize: vertical;
    min-height: 120px;
}

/* Toolbar de formato de texto */
.text-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-300);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.text-toolbar + textarea.form-control-modern {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* Lista de imágenes */
.image-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.image-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.image-list-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.image-list-url {
    flex: 1;
    font-size: 0.875rem;
    color: var(--scout-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Acciones de fila en tabla */
.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Leyenda de acciones */
.actions-legend {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
}

.legend-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--scout-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--scout-text-primary);
}

/* Loading spinner */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.spinner-modern {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--scout-text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--scout-text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.9375rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-container {
        padding: 1.5rem 1rem;
    }
    
    .admin-title {
        font-size: 2rem;
    }
    
    .legend-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-title {
        font-size: 1.75rem;
    }
    
    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-section {
        width: 100%;
    }
    
    .toolbar-section.actions {
        margin-left: 0;
    }
    
    .search-group {
        max-width: none;
        flex-direction: column;
    }

    .search-group .search-input {
        width: 100%;
    }

    .search-group .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    .modern-select, .modern-input {
        width: 100%;
        min-width: 0;
    }
    
    .modern-table-container {
        overflow-x: auto;
    }
    
    .modern-table {
        min-width: 800px;
    }
    
    .legend-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 1rem 0.75rem;
    }
    
    .admin-toolbar {
        padding: 1rem;
    }
    
    .modern-form {
        padding: 1.5rem;
    }
    
    .form-section-title {
        font-size: 1.125rem;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Utilidades adicionales */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.w-full { width: 100%; }
.w-auto { width: auto; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Animaciones suaves */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   ADMIN HERO — Encabezado gradiente scout compartido entre paneles admin.
   ==========================================================================
   Uso esta clase en lugar de duplicar el hero en cada .razor.css.
   No está en un archivo scoped de Blazor, por lo tanto aplica globalmente;
   los prefijos admin- y admin-stat- son suficientemente específicos para
   evitar colisiones con Bootstrap u otras reglas globales.

   Uso:
     <div class="admin-hero">
       <div class="admin-hero-content">
         <div>
           <a href="..." class="admin-hero-back">...</a>
           <h1 class="admin-hero-title"><i class="fas fa-ICON me-2"></i>TÍTULO</h1>
           <p class="admin-hero-subtitle">SUBTÍTULO</p>
         </div>
         <div class="admin-hero-right">          ← opcional: badges o CTA
           <a class="admin-hero-cta">...</a>
         </div>
       </div>
     </div>
   ========================================================================== */

/* ── Bloque hero ────────────────────────────────────────────────────────── */
.admin-hero {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 60%, #388E3C 100%);
    padding: 2.5rem 2rem 3rem;
}

/* ── Contenedor centrado: columna en mobile, fila en sm+ ── */
.admin-hero-content {
    max-width: 1360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .admin-hero-content {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

/* ── Enlace "Volver" sutil sobre el gradiente ── */
.admin-hero-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
    margin-bottom: 0.4rem;
}

.admin-hero-back:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ── Título principal ── */
.admin-hero-title {
    font-family: var(--font-heading, 'Bitter', serif);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0;
}

/* ── Subtítulo / bajada ── */
.admin-hero-subtitle {
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

/* ── Lado derecho: badges + CTA ── */
.admin-hero-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

/* ── Badge de resumen (conteos, estadísticas) ── */
.admin-stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    border-radius: 0.75rem;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Botón CTA dentro del hero (borde sutil blanco semitransparente) ── */
.admin-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.40);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.admin-hero-cta:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.60);
    color: #ffffff !important;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ── Responsive mobile ── */
@media (max-width: 640px) {
    .admin-hero {
        padding: 1.5rem 1rem 2rem;
    }

    .admin-hero-right {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-hero-cta {
        justify-content: center;
    }
}
