/**
 * Portal cliente (Fase 4, sección 13.4): estilos completamente encapsulados
 * bajo .sephor-support-portal, sin ninguna dependencia del tema activo.
 * No reutiliza admin.css a propósito, aunque comparta algunos nombres de
 * clase (p. ej. .ss-badge, generado por Sephor_Support_Admin_Render): ese
 * HTML se reutiliza, pero su aspecto se define aquí, aislado.
 */

/*
 * Oculta la cabecera del tema activo en la página del portal (a petición
 * de María: que se vea como una pantalla propia, no como una página más
 * del sitio con el título y el menú del tema encima). Esta hoja solo se
 * carga en la página que contiene el shortcode [sephor_support_portal]
 * (ver Sephor_Support_Portal::maybe_enqueue_assets()), así que esta
 * regla nunca afecta al resto del sitio.
 *
 * #masthead/.site-header son los nombres que usa Astra (el tema activo
 * en jobs.sephorconsulting.es) y la mayoría de temas basados en la
 * plantilla _s/Underscores de WordPress. Si el tema cambiara a uno con
 * otros nombres, esta regla dejaría de aplicar y habría que ajustarla.
 */
#masthead,
.site-header,
header.site-header {
    display: none !important;
}

/*
 * Igual que la cabecera de arriba, pero con el pie de página del tema
 * (a petición de María, 18/08/2026): #colophon/.site-footer son los
 * nombres que usa Astra y la mayoría de temas _s/Underscores.
 */
#colophon,
.site-footer,
footer.site-footer {
    display: none !important;
}

/*
 * El tema activo (Astra) da color y subrayado propios a los enlaces —y,
 * según su configuración de tipografía, también a elementos como <dd>—
 * dentro del contenido de la página, ya que el shortcode se imprime a
 * través de the_content(). .sephor-support-portal está pensado para
 * verse igual sin importar el tema, así que se reafirma aquí el color y
 * el subrayado de enlaces (y de los valores de .ssp-detail-list, que no
 * son enlaces) en vez de heredar lo que decida el tema.
 */
.sephor-support-portal a {
    /* !important: mismo motivo que en app.css (el shortcode se imprime
       dentro de the_content(), expuesto a los estilos del tema activo). */
    text-decoration: none !important;
}

.sephor-support-portal {
    --ssp-blue: #009bdb; /* Azul de marca de Sephor Consulting, tomado del logo. */
    --ssp-dark: #1e293b;
    --ssp-green: #16a34a;
    --ssp-orange: #f59e0b;
    --ssp-red: #dc2626;
    --ssp-gray: #687280;
    --ssp-border: #dcdfe4;
    --ssp-bg: #f7f8fa;
    --ssp-surface: #ffffff;
    --ssp-text: #1e293b;
    --ssp-muted: #687280;

    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
    color: var(--ssp-text);
    box-sizing: border-box;
}
.sephor-support-portal *,
.sephor-support-portal *::before,
.sephor-support-portal *::after {
    box-sizing: inherit;
}

/* --- Cabecera y navegación ------------------------------------------- */
.sephor-support-portal .ssp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.sephor-support-portal .ssp-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.sephor-support-portal .ssp-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--ssp-dark);
}
.sephor-support-portal .ssp-header-logo {
    display: block;
    height: 80px;
    width: auto;
}
.sephor-support-portal .ssp-subtitle {
    color: var(--ssp-muted);
    margin: 4px 0 20px;
}
.sephor-support-portal .ssp-logout {
    color: var(--ssp-muted);
    text-decoration: none;
    font-size: 14px;
}
.sephor-support-portal .ssp-logout:hover {
    color: var(--ssp-blue);
}
.sephor-support-portal .ssp-breadcrumb {
    margin: 0 0 16px;
}
.sephor-support-portal .ssp-breadcrumb a {
    color: var(--ssp-blue);
    text-decoration: none;
}

/* --- Botones ----------------------------------------------------------- */
.sephor-support-portal .ssp-button {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.4;
}
.sephor-support-portal .ssp-button-primary {
    background: var(--ssp-blue);
    color: #fff;
}
.sephor-support-portal .ssp-button-primary:hover {
    background: #1d4ed8;
}
.sephor-support-portal .ssp-button-secondary {
    background: var(--ssp-surface);
    color: var(--ssp-dark);
    border-color: var(--ssp-border);
}
.sephor-support-portal .ssp-button-secondary:hover {
    background: var(--ssp-bg);
}

/* --- Login / acceso denegado ------------------------------------------ */
.sephor-support-portal .ssp-login-card {
    max-width: 380px;
    margin: 40px auto;
    background: var(--ssp-surface);
    border: 1px solid var(--ssp-border);
    border-radius: 10px;
    padding: 28px;
    text-align: center;
}
.sephor-support-portal .ssp-logo {
    display: block;
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
}
.sephor-support-portal .ssp-form {
    text-align: left;
}
.sephor-support-portal .ssp-notice {
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.sephor-support-portal .ssp-notice-error {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Formularios --------------------------------------------------------*/
.sephor-support-portal .ssp-field {
    margin-bottom: 14px;
}
.sephor-support-portal .ssp-field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}
.sephor-support-portal .ssp-field-inline label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
}
.sephor-support-portal input[type="text"],
.sephor-support-portal input[type="search"],
.sephor-support-portal input[type="email"],
.sephor-support-portal input[type="password"],
.sephor-support-portal input[type="date"],
.sephor-support-portal input[type="url"],
.sephor-support-portal select,
.sephor-support-portal textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--ssp-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--ssp-surface);
    color: var(--ssp-text);
}
.sephor-support-portal textarea {
    resize: vertical;
}
.sephor-support-portal .ssp-required {
    color: var(--ssp-red);
}
.sephor-support-portal .ssp-form-intro {
    color: var(--ssp-muted);
    margin: -8px 0 18px;
}
.sephor-support-portal .ssp-field-note {
    color: var(--ssp-muted);
    font-size: 13px;
    margin: 4px 0 0;
}
.sephor-support-portal .ssp-form-actions {
    margin-top: 8px;
}
.sephor-support-portal .ssp-notice-success {
    background: #dcfce7;
    color: #166534;
}

/* --- Filtros del feed --------------------------------------------------- */
.sephor-support-portal .ssp-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    background: var(--ssp-surface);
    border: 1px solid var(--ssp-border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}
.sephor-support-portal .ssp-filters .ssp-field {
    margin-bottom: 0;
    min-width: 140px;
    flex: 1 1 140px;
}
.sephor-support-portal .ssp-field-date {
    flex: 1 1 130px;
}

.sephor-support-portal .ssp-empty,
.sephor-support-portal .ssp-empty-inline {
    color: var(--ssp-muted);
}
.sephor-support-portal .ssp-empty {
    text-align: center;
    padding: 40px 0;
}

/* --- Tabla del feed / tarjetas en móvil (sección 13.4) ------------------ */
.sephor-support-portal .ssp-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--ssp-surface);
    border: 1px solid var(--ssp-border);
    border-radius: 10px;
    overflow: hidden;
}
.sephor-support-portal .ssp-table th,
.sephor-support-portal .ssp-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ssp-border);
    font-size: 14px;
}
.sephor-support-portal .ssp-table thead th {
    background: var(--ssp-bg);
    font-weight: 600;
    color: var(--ssp-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.sephor-support-portal .ssp-table tbody tr:last-child td {
    border-bottom: none;
}
.sephor-support-portal .ssp-table a {
    color: var(--ssp-blue);
    text-decoration: none;
}

@media (max-width: 700px) {
    .sephor-support-portal .ssp-table-responsive thead {
        display: none;
    }
    .sephor-support-portal .ssp-table-responsive,
    .sephor-support-portal .ssp-table-responsive tbody,
    .sephor-support-portal .ssp-table-responsive tr,
    .sephor-support-portal .ssp-table-responsive td {
        display: block;
        width: 100%;
    }
    .sephor-support-portal .ssp-table-responsive tr {
        margin-bottom: 14px;
        border: 1px solid var(--ssp-border);
        border-radius: 10px;
        padding: 4px 14px;
    }
    .sephor-support-portal .ssp-table-responsive td {
        border-bottom: 1px solid var(--ssp-bg);
        padding: 8px 0;
    }
    .sephor-support-portal .ssp-table-responsive td:last-child {
        border-bottom: none;
    }
    .sephor-support-portal .ssp-table-responsive td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--ssp-muted);
        margin-bottom: 2px;
    }
}

/* --- Paginación ---------------------------------------------------------- */
.sephor-support-portal .ssp-pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.sephor-support-portal .ssp-page-link {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--ssp-border);
    color: var(--ssp-text);
    text-decoration: none;
    font-size: 14px;
}
.sephor-support-portal .ssp-page-link.is-current {
    background: var(--ssp-blue);
    border-color: var(--ssp-blue);
    color: #fff;
}

/* --- Ficha individual ----------------------------------------------------*/
.sephor-support-portal .ssp-card {
    background: var(--ssp-surface);
    border: 1px solid var(--ssp-border);
    border-radius: 10px;
    padding: 22px;
}
.sephor-support-portal .ssp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.sephor-support-portal .ssp-card-header h2 {
    margin: 0;
    font-size: 19px;
}
.sephor-support-portal .ssp-detail-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 12px;
    margin: 0 0 20px;
}
.sephor-support-portal .ssp-detail-list dt {
    color: var(--ssp-muted);
    font-weight: 600;
    font-size: 14px;
}
.sephor-support-portal .ssp-detail-list dd {
    margin: 0;
    font-size: 14px;
    color: var(--ssp-text) !important;
    text-decoration: none !important;
    font-weight: 400;
}
.sephor-support-portal .ssp-card-block {
    border-top: 1px solid var(--ssp-bg);
    padding-top: 16px;
    margin-top: 16px;
}
.sephor-support-portal .ssp-card-block h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ssp-muted);
    margin: 0 0 8px;
}
.sephor-support-portal .ssp-description,
.sephor-support-portal .ssp-response-body {
    white-space: pre-wrap;
    line-height: 1.5;
}
.sephor-support-portal .ssp-response-meta {
    color: var(--ssp-muted);
    font-size: 13px;
    margin: 0 0 6px;
}
.sephor-support-portal .ssp-attachments {
    margin: 0;
    padding-left: 18px;
}
.sephor-support-portal .ssp-attachments a {
    color: var(--ssp-blue);
}

@media (max-width: 600px) {
    .sephor-support-portal .ssp-detail-list {
        grid-template-columns: 1fr;
    }
    .sephor-support-portal .ssp-detail-list dt {
        margin-top: 8px;
    }
}

/* --- Badges de estado/facturación (misma clase que en admin, colores
       redefinidos aquí para no depender de admin.css) --------------------- */
.sephor-support-portal .ss-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.6;
    white-space: nowrap;
}
.sephor-support-portal .ss-badge-status-new { background: #dbeafe; color: #1e3a8a; }
.sephor-support-portal .ss-badge-status-pending { background: #fef3c7; color: #92400e; }
.sephor-support-portal .ss-badge-status-in_progress { background: #dcfce7; color: #166534; }
.sephor-support-portal .ss-badge-status-waiting_client { background: #ede9fe; color: #5b21b6; }
.sephor-support-portal .ss-badge-status-resolved { background: #ccfbf1; color: #115e59; }
.sephor-support-portal .ss-badge-status-closed { background: #e5e7eb; color: #374151; }
.sephor-support-portal .ss-badge-status-cancelled { background: #fee2e2; color: #991b1b; }
.sephor-support-portal .ss-badge-billing-warranty { background: #e0e7ff; color: #3730a3; }
.sephor-support-portal .ss-badge-billing-maintenance { background: #fef3c7; color: #92400e; }
.sephor-support-portal .ss-badge-billing-hours_pack { background: #dcfce7; color: #166534; }

/* --- Accesibilidad (sección 13.5) --------------------------------------- */
.sephor-support-portal .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.sephor-support-portal a:focus-visible,
.sephor-support-portal button:focus-visible,
.sephor-support-portal input:focus-visible,
.sephor-support-portal select:focus-visible {
    outline: 2px solid var(--ssp-blue);
    outline-offset: 2px;
}
