/**
 * Hoja de estilos exclusiva para el módulo de constancias generales de adultos / staff.
 * VEM Torneos - Estilo Institucional Moderno
 */

/* ==========================================================================
   1. CONTENEDOR RAÍZ / ROOT
   ========================================================================== */
#vem-staff-certificates-root {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
    border: 1px solid #d7e2ea;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    color: #263645;
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#vem-staff-certificates-root h2 {
    font-size: 28px;
    color: #12395b;
    margin-top: 0;
    margin-bottom: 8px;
    font-weight: 800;
    line-height: 1.2;
}

#vem-staff-certificates-root .vem-staff-cert-lead {
    font-size: 15px;
    line-height: 1.6;
    color: #52616f;
    margin-top: 0;
    margin-bottom: 20px;
    max-width: 90%;
}

/* ==========================================================================
   2. ALERTAS / AVISOS
   ========================================================================== */
#vem-staff-certificates-root .vem-staff-cert-alert-manual {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
    border-left: 5px solid #f59e0b;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ==========================================================================
   3. TARJETAS / CARDS
   ========================================================================== */
#vem-staff-certificates-root .vem-staff-cert-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px 24px;
    border: 1px solid #dbe4ea;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
    margin-bottom: 24px;
    box-sizing: border-box;
}

#vem-staff-certificates-root .vem-staff-cert-card h3 {
    color: #12395b;
    font-size: 19px;
    font-weight: 800;
    border-bottom: 1px solid #e6eef5;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 18px;
}

/* ==========================================================================
   4. GRILLA Y COMPONENTES DE FORMULARIO
   ========================================================================== */
#vem-staff-certificates-root .vem-staff-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    align-items: end;
    margin-bottom: 15px;
}

#vem-staff-certificates-root .vem-staff-cert-field {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#vem-staff-certificates-root .vem-staff-cert-field label {
    font-weight: 700;
    font-size: 13px;
    color: #34495e;
    margin-bottom: 6px;
    text-align: left;
}

/* Estilización Scopeada y Unificada de Inputs */
#vem-staff-certificates-root input[type="text"],
#vem-staff-certificates-root textarea,
#vem-staff-certificates-root select {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid #b8c8d6;
    background: #ffffff;
    padding: 9px 12px;
    font-size: 14px;
    color: #1f2d3d;
    box-shadow: none;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#vem-staff-certificates-root input[type="text"]:focus,
#vem-staff-certificates-root textarea:focus,
#vem-staff-certificates-root select:focus {
    border-color: #0b6fa4;
    box-shadow: 0 0 0 3px rgba(11, 111, 164, 0.15);
    outline: none;
}

#vem-staff-certificates-root textarea {
    min-height: 150px;
    line-height: 1.5;
    resize: vertical;
}

#vem-staff-certificates-root select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334495e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#vem-staff-certificates-root input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    vertical-align: middle;
}

/* ==========================================================================
   5. BOTONES Y ACCIONES CONTROLES
   ========================================================================== */
#vem-staff-certificates-root .vem-staff-cert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 16px;
    min-height: 38px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

#vem-staff-certificates-root .vem-staff-cert-btn-primary {
    background: #0b6fa4;
    border-color: #0b6fa4;
    color: #ffffff !important;
}

#vem-staff-certificates-root .vem-staff-cert-btn-primary:hover:not(:disabled) {
    background: #084f75;
    border-color: #084f75;
}

#vem-staff-certificates-root .vem-staff-cert-btn-secondary {
    background: #ffffff;
    border-color: #0b6fa4;
    color: #0b6fa4 !important;
}

#vem-staff-certificates-root .vem-staff-cert-btn-secondary:hover:not(:disabled) {
    background: #eef7ff;
}

#vem-staff-certificates-root .vem-staff-cert-btn:disabled {
    color: #a7aaad !important;
    background: #f6f7f7 !important;
    border-color: #dcdcde !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* Botón Destacado de Generación */
#vem-staff-certificates-root #vem-staff-certificates-generate-selected {
    min-height: 46px;
    padding: 0 28px;
    font-size: 15px;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(11, 111, 164, 0.22);
}

#vem-staff-certificates-root #vem-staff-certificates-generate-selected:hover:not(:disabled) {
    box-shadow: 0 4px 8px rgba(11, 111, 164, 0.15);
}

/* ==========================================================================
   6. CONTADOR DESTACADO Y PLACEHOLDERS
   ========================================================================== */
#vem-staff-certificates-root #vem-staff-certificates-staff-counter {
    background: #eaf4fb;
    border-left: 5px solid #0b6fa4;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 16px;
    margin-bottom: 14px;
    color: #12395b;
    font-weight: 800;
    font-size: 13.5px;
    box-sizing: border-box;
}

#vem-staff-certificates-root .vem-staff-cert-placeholder-text {
    color: #667085;
    background: #f8fbfd;
    border: 1px dashed #c8d6e2;
    border-radius: 10px;
    padding: 16px;
    font-style: italic;
    font-size: 13.5px;
    text-align: center;
}

/* ==========================================================================
   7. TABLAS REACTIVAS (Sobrescritura del JS widefat)
   ========================================================================== */
#vem-staff-certificates-root table.wp-list-table {
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1px solid #dbe4ea !important;
    background: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01) !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 12px !important;
}

#vem-staff-certificates-root table.wp-list-table thead tr {
    background: #12395b !important;
}

#vem-staff-certificates-root table.wp-list-table th {
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 12px 10px !important;
    font-size: 13px !important;
    border: none !important;
}

#vem-staff-certificates-root table.wp-list-table td {
    padding: 10px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f0f0f1 !important;
    color: #2c3338 !important;
    font-size: 13px !important;
}

#vem-staff-certificates-root table.wp-list-table tbody tr:last-child td {
    border-bottom: none !important;
}

#vem-staff-certificates-root table.wp-list-table tbody tr:nth-child(even) {
    background: #f8fbfd !important;
}

#vem-staff-certificates-root table.wp-list-table tbody tr:hover {
    background: #eef7ff !important;
}

/* ==========================================================================
   8. VISTA PREVIA INTEGRADA
   ========================================================================== */
#vem-staff-certificates-root #vem-staff-certificates-preview {
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid #dbe4ea !important;
    border-left: 5px solid #0b6fa4 !important;
    box-shadow: 0 4px 12px rgba(11, 111, 164, 0.04) !important;
    padding: 20px !important;
}

#vem-staff-certificates-root #vem-staff-certificates-preview h3 {
    margin-bottom: 4px !important;
}

#vem-staff-certificates-root #vem-staff-certificates-preview-content {
    border-radius: 10px !important;
    background: #fbfdff !important;
    border: 1px dashed #b8c8d6 !important;
    font-size: 15px !important;
    line-height: 1.7 !important;
    padding: 18px !important;
    font-family: Georgia, Cambria, "Times New Roman", Times, serif !important;
    color: #1f2d3d !important;
    box-sizing: border-box;
}

#vem-staff-certificates-root #vem-staff-certificates-preview-obs {
    margin-top: 12px !important;
    font-weight: 700 !important;
    color: #d63638 !important;
    font-size: 13px !important;
}

/* ==========================================================================
   9. BLOQUE FINAL DE ACCIONES Y MENSAJES
   ========================================================================== */
#vem-staff-certificates-root .vem-staff-cert-actions-block {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #dbe4ea;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 25px;
    box-sizing: border-box;
}

#vem-staff-certificates-root #vem-staff-certificates-message {
    padding: 8px 10px;
    min-height: 22px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    box-sizing: border-box;
    flex-grow: 1;
}

/* ==========================================================================
   10. QUERIES RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    #vem-staff-certificates-root {
        padding: 18px;
    }

    #vem-staff-certificates-root .vem-staff-cert-card {
        padding: 18px;
    }
}

@media (max-width: 700px) {
    #vem-staff-certificates-root {
        padding: 14px;
    }

    #vem-staff-certificates-root h2 {
        font-size: 23px;
    }

    #vem-staff-certificates-root .vem-staff-cert-lead {
        max-width: 100%;
        font-size: 14px;
    }

    #vem-staff-certificates-root .vem-staff-cert-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    #vem-staff-certificates-root .vem-staff-cert-actions-block {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px;
    }

    #vem-staff-certificates-root #vem-staff-certificates-message {
        text-align: center !important;
        margin-top: 5px;
    }

    #vem-staff-certificates-root table.wp-list-table {
        font-size: 12px !important;
    }
    
    #vem-staff-certificates-root table.wp-list-table th,
    #vem-staff-certificates-root table.wp-list-table td {
        padding: 8px 6px !important;
    }
}