/**
 * @fileoverview Stylesheet específico para ArtistTaskPage.
 * @file artist_task_page.css
 * @project Chicky Galery
 * @author Juan M
 *
 * Este archivo depende de global.css.
 * Aquí solo van estilos propios del Panel de Artista.
 *
 * NOTA: pase de mejora visual. Ningún color (var(--...) ni hex) fue
 * modificado a propósito. Los cambios son de espaciado, jerarquía
 * tipográfica, transiciones y estados hover/focus.
 */

/* ============================================= */
/* == 1. PAGE WRAPPER                         == */
/* ============================================= */

.artist-task-page {
    width: min(100%, 1000px);
}

/* ============================================= */
/* == 2. STATUS DE PEDIDOS                    == */
/* ============================================= */

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 16px 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.status-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.status-item p {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

/* ============================================= */
/* == 3. ALIANZAS / COARTISTAS                == */
/* ============================================= */

.alliance-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.alliance-search-bar select {
    flex: 1;
}

.alliance-search-bar button {
    width: auto;
    white-space: nowrap;
}

.alliance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.sub-table-box {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.15s ease;
}

.sub-table-box:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.sub-table-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

/* ============================================= */
/* == 4. FORMULARIO DE TAREAS                 == */
/* ============================================= */

.task-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.form-group {
    min-width: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.task-form-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.task-form-actions button {
    width: auto;
}

.btn-secondary {
    background: #f1e4f4;
    color: var(--primary-color);
    padding: 11px 18px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
    background: #ead3ef;
    transform: translateY(-1px);
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================= */
/* == 5. TABLA DE TAREAS                      == */
/* ============================================= */

.quest-row {
    background: #ffffff;
    border-left: 4px solid var(--primary-color);
    transition: background-color 0.15s ease;
}

.quest-row:hover {
    background: #faf2fb;
}

.quest-table td small {
    display: inline-block;
    margin-top: 5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.reward-badge {
    display: inline-block;
    background: rgba(255, 218, 0, 0.18);
    color: #9a7500;
    border: 1px solid #e6c200;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.83rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ============================================= */
/* == 6. MENÚ DE TAREAS                       == */
/* ============================================= */

.tarea-menu-wrapper {
    position: relative;
    display: inline-block;
}

.tarea-menu {
    position: absolute;
    right: 0;
    top: 38px;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    z-index: 20;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.tarea-menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    padding: 10px 11px;
    border-radius: 7px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.tarea-menu button:hover {
    background: var(--bg-panel-soft);
}

.oculto {
    display: none !important;
}

/* ============================================= */
/* == 7. NOTAS                                == */
/* ============================================= */

.nota-item {
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease;
}

.nota-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.nota-item p {
    margin: 0;
    color: var(--text-main);
    line-height: 1.5;
}

.nota-item small {
    color: var(--text-muted);
}

.nota-item button {
    align-self: flex-end;
}

/* ============================================= */
/* == 8. TICKETS                              == */
/* ============================================= */

.ticket-panel {
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

/* ============================================= */
/* == 9. MI PÁGINA DE ARTISTA                 == */
/* ============================================= */

.artist-page-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 18px;
}

.artist-page-card h3 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1.05rem;
}

.artist-page-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.artist-page-card .btn-primary,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.artist-page-card .btn-primary:hover,
.btn-primary:hover {
    transform: translateY(-1px);
}

/* ============================================= */
/* == 10. EMPTY STATES                         == */
/* ============================================= */

.empty-table,
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 22px 16px;
    font-size: 0.92rem;
}

/* ============================================= */
/* == 11. BOTONES MINI / ACCIONES              == */
/* ============================================= */

.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    border-radius: 7px;
    transition: background-color 0.12s ease, transform 0.12s ease;
}

.btn-mini:hover {
    background: var(--bg-panel-soft);
    transform: translateY(-1px);
}

.btn-mini:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.btn-confirmar {
    color: #198754;
}

.btn-rechazar,
.btn-deny {
    color: #dc3545;
}

/* ============================================= */
/* == 12. DRAG & DROP DE OBRAS                 == */
/* ============================================= */


.drag-drop-section {
    text-align: center;
    margin: 28px auto;
    max-width: 650px;
}

.drag-drop-section h2 {
    margin-bottom: 18px;
    color: var(--text-main);
}


/* =============================================
   ZONA DROP
============================================= */

#dropZone {
    width: 100%;
    min-height: 180px;

    border: 3px dashed #cfcfcf;
    border-radius: 16px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 10px;

    background: #fafafa;

    cursor: pointer;

    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease;
}

#dropZone i {
    font-size: 2.4rem;
    color: var(--primary-color);
}

#dropZone span {
    font-weight: 700;
    color: var(--text-main);
}

#dropZone:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

#dropZone.hover {
    border-color: var(--primary-color);
    background: #f7edfa;
    transform: scale(1.01);
}

#dropZone.archivo-seleccionado {
    border-color: #2f7d32;
    background: #f1f8f2;
}

#dropZone.archivo-seleccionado i {
    color: #2f7d32;
}


/* =============================================
   INPUT OCULTO
============================================= */

#fileInput {
    display: none;
}


/* =============================================
   PREVIEW
============================================= */

#preview-container {
    width: 100%;
    margin-top: 18px;
}

#preview-container img {
    display: block;

    width: 100%;
    max-height: 350px;

    object-fit: contain;

    border-radius: 14px;

    border: 1px solid var(--border);

    background: #f5f5f5;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.12);
}

#preview.oculto {
    display: none !important;
}


/* =============================================
   VALIDACIÓN
============================================= */

.image-validation-message {
    margin-top: 14px;

    padding: 14px 16px;

    border-radius: 10px;

    font-size: 0.9rem;

    line-height: 1.5;

    text-align: left;

    font-weight: 600;
}

.image-validation-message.ok {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #81c784;
}

.image-validation-message.error {
    background: #fdecea;
    color: #b00020;
    border: 1px solid #f5c2c7;
}

.image-validation-message.oculto {
    display: none !important;
}


/* =============================================
   REQUISITOS
============================================= */

.image-requirements {
    margin-top: 16px;

    padding: 14px 18px;

    border-radius: 10px;

    background: var(--bg-panel-soft);

    border: 1px solid var(--border);

    text-align: left;
}

.image-requirements h4 {
    margin: 0 0 10px;

    color: var(--text-main);

    font-size: 0.95rem;
}

.image-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.image-requirements li {
    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 0.86rem;
}


/* =============================================
   FORMULARIO
============================================= */

.artist-upload-actions .form-group {
    margin-bottom: 16px;
    text-align: left;
}

.artist-upload-actions label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--text-main);
}

.artist-upload-actions label i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.artist-upload-actions input[type="text"],
.artist-upload-actions input[type="number"] {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 0.95rem;
    color: var(--text-main);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.artist-upload-actions input[type="text"]:focus,
.artist-upload-actions input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 149, 46, 178), 0.15);
}

/* Campo de precio con prefijo $ */
.input-with-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-prefix:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 149, 46, 178), 0.15);
}

.input-with-prefix .prefix {
    padding: 0 12px;
    color: var(--text-muted);
    font-weight: 700;
    background: var(--bg-panel-soft);
    align-self: stretch;
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
}

.input-with-prefix input {
    border: none !important;
    box-shadow: none !important;
    padding: 11px 14px !important;
}

.input-with-prefix input:focus {
    box-shadow: none !important;
}

/* Precio dentro de la tarjeta de la galería */
.obra-price {
    display: inline-block;
    margin-top: 6px;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
}

/* =============================================
   BOTÓN
============================================= */

#btn-guardar {
    margin-top: 8px;
}

#btn-guardar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
/* =============================================
   13. GALERÍA DE OBRAS (corregido)
   El JS genera .obra-image / .obra-overlay / .btn-view /
   .obra-artist / .btn-delete-obra. El overlay usa :hover para
   aparecer, pero eso no existe en touch ni con navegación por
   teclado, así que se agrega :focus-within y una regla en el
   breakpoint móvil (sección 15) para mostrarlo siempre ahí.
============================================= */

.obra-image {
    position: relative;
    overflow: hidden;
}

.obra-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.obra-card:hover .obra-image img {
    transform: scale(1.05);
}

.obra-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.obra-card:hover .obra-overlay,
.obra-card:focus-within .obra-overlay {
    opacity: 1;
}

.btn-view,
.btn-delete-obra {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.btn-view {
    background: var(--primary-color);
    color: #fff;
}

.btn-view:hover {
    transform: translateY(-1px);
}

/* Botón de eliminar con un "tag"/color distinto al de "Ver obra" */
.btn-delete-obra {
    background: #dc3545;
    color: #fff;
}

.btn-delete-obra:hover {
    background: #b02a37;
    transform: translateY(-1px);
}

.btn-delete-obra:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.obra-artist {
    display: block;
    margin: 4px 0 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.obra-artist i {
    margin-right: 4px;
    color: var(--primary-color);
}

/* ============================================= */
/* == 14. UPLOAD ART PREVIEW EXTRA             == */
/* ============================================= */

#upload-art-preview {
    max-width: 240px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 12px;
}

/* ============================================= */
/* == COMISIONES EN PANEL DE ARTISTA           == */
/* ============================================= */

.commission-request-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
    transition: box-shadow 0.15s ease;
}

.commission-request-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.commission-request-info h4 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1rem;
}

.commission-request-info p {
    margin: 0 0 6px;
    color: var(--text-main);
    line-height: 1.45;
    font-size: 0.92rem;
}

.commission-request-info small {
    color: var(--text-muted);
}

.commission-request-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
}

.commission-request-actions button {
    width: 100%;
}

.commission-task-note {
    color: var(--text-muted);
    font-style: italic;
}

.status-pendiente {
    background-color: var(--primary-color);
}

.status-rechazado {
    background-color: var(--error-color);
}

@media (max-width: 700px) {
    .commission-request-card {
        flex-direction: column;
    }

    .commission-request-actions {
        width: 100%;
    }
}

/* ============================================= */
/* == 15. RESPONSIVE                           == */
/* ============================================= */

@media (max-width: 700px) {
    .task-form,
    .alliance-grid {
        grid-template-columns: 1fr;
    }

    .alliance-search-bar,
    .artist-page-card,
    .status-item {
        flex-direction: column;
        align-items: stretch;
    }

    .alliance-search-bar button,
    .task-form-actions button,
    .artist-page-card .btn-primary {
        width: 100%;
    }

    .task-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tarea-menu {
        right: auto;
        left: 0;
    }

    /* La galería depende de :hover para mostrar "Ver obra" / "Eliminar",
       pero en touch no hay hover: se muestra siempre en móvil. */
    .obra-overlay {
        position: static;
        opacity: 1;
        background: transparent;
        padding: 10px 0 0;
    }

    .obra-card:hover .obra-image img {
        transform: none;
    }
}