/**
 * @fileoverview Stylesheet for the Commissions page.
 * @file comisiones.css
 * @project Chicky Galery
 * @author Juan M
 *
 * Sections:
 * 1. Page layout
 * 2. Cards
 * 3. Form elements
 * 4. Commission select/details
 * 5. Status card
 * 6. History
 * 7. Real-Time Badges
 * 8. Responsive
 * 9. Reduced motion
 */

:root {
    --font-display: 'Fraunces', Georgia, serif;
}

/* ============================================= */
/* == 1. PAGE LAYOUT                          == */
/* ============================================= */

.comisiones-container {
    width: min(100%, 1200px);
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header::before {
    content: "COMISIONES";
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-header h2 {
    margin: 0 0 8px;
    color: var(--text-main);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.9rem, 4.2vw, 2.6rem);
    letter-spacing: -0.01em;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
}

.comisiones-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    margin: 0 auto;
    align-items: start;
    position: relative;
}

@media (min-width: 769px) {
    .comisiones-grid::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: calc(60% + 1px);
        border-left: 2px dashed var(--light-gray);
    }
}

/* ============================================= */
/* == 2. CARDS                                == */
/* ============================================= */

.form-card,
.status-card,
.historial-card {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 2rem 2.25rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--light-gray);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-card:hover,
.status-card:hover,
.historial-card:hover {
    transform: translateY(-2px);
}

.form-card h3,
.status-card h3,
.historial-card h3 {
    margin: 0 0 1.5rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--light-gray);
    color: var(--text-main);
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.section-eyebrow {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--primary-color);
    margin-bottom: 6px;
}

/* ============================================= */
/* == 3. FORM ELEMENTS                        == */
/* ============================================= */

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input,
.form-group textarea,
.form-group select,
.form-control {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 0.96rem;
    font-family: inherit;
    background-color: #ffffff;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(153, 84, 144, 0.2);
}

.form-group input.is-invalid,
.form-group textarea.is-invalid,
.form-group select.is-invalid {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.82rem;
    display: none;
    margin-top: 6px;
}

.error-message.visible {
    display: block;
}

.success-message {
    display: none;
    text-align: center;
    padding: 1.5rem;
    background-color: #eafaf1;
    color: #247d4d;
    border-radius: var(--border-radius);
    margin-top: 1.5rem;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    margin-top: 0.4rem;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-submit:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
}

.btn-submit:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================= */
/* == 4. COMMISSION SELECT DETAILS             == */
/* ============================================= */

.artist-preview-card {
    display: none;
    background: var(--bg-panel-soft);
    border: 1px solid var(--light-gray);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 16px 18px;
    margin-top: 10px;
}

.artist-preview-card.visible {
    display: block;
}

.artist-preview-card h4 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1rem;
}

.artist-preview-card p {
    margin: 0 0 8px;
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.92rem;
}

.artist-style-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.artist-style-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    background-color: #f1e4f4;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Resets the native fieldset/legend chrome so the <fieldset> used for the
   contact-method radios looks identical to a regular .form-group. */
.contact-method-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.35rem;
    min-width: 0;
}

.contact-method-fieldset legend {
    padding: 0;
    margin-bottom: 0.45rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    width: 100%;
}

.contact-method-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.contact-method-option {
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 11px 10px;
    cursor: pointer;
    text-align: center;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-method-option input {
    margin-right: 6px;
}

.contact-method-option:hover {
    border-color: var(--primary-color);
    background-color: var(--bg-panel-soft);
}

/* Keyboard focus lands on the radio input itself; surface it on the
   surrounding label so it matches the focus style used on other fields. */
.contact-method-option:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(153, 84, 144, 0.2);
}

/* ============================================= */
/* == 5. STATUS CARD                          == */
/* ============================================= */

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.status-item:last-child {
    border-bottom: none;
}

.status-item-selected {
    background: var(--bg-panel-soft);
    border: 1px solid var(--light-gray);
    border-left: 3px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 16px 18px;
    margin-bottom: 1.25rem;
}

.status-item-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.96rem;
}

.status-item-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.status-tag {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    white-space: nowrap;
}

.status-en-progreso {
    background-color: var(--progress-color);
}

.status-propuesta {
    background-color: var(--warning-color);
    color: var(--dark-text);
}

.status-completado {
    background-color: var(--success-color);
}

.status-pendiente {
    background-color: var(--primary-color);
}

.status-rechazado {
    background-color: var(--error-color);
}

.status-actions {
    margin-top: 0.25rem;
}

.status-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

.status-link::after {
    content: " →";
    transition: transform 0.15s ease;
}

.status-link:hover::after {
    transform: translateX(4px);
}

/* ============================================= */
/* == 6. HISTORIAL DE SOLICITUDES             == */
/* ============================================= */

.historial-card {
    margin-top: 32px;
}

.historial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--light-gray);
}

.historial-item:last-child {
    border-bottom: none;
}

.historial-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.98rem;
}

.historial-item small {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.empty-state {
    color: var(--text-muted);
    font-size: 0.92rem;
    padding: 8px 0;
}

/* ============================================= */
/* == 7. REAL-TIME BADGES (CSHTML EXTENSION)   == */
/* ============================================= */

.live-activity-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 14px;
    background-color: var(--bg-panel-soft);
    border: 1px solid var(--border);
}

.live-activity-badge .pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    position: relative;
}

.live-activity-badge .pulse-dot::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--success-color);
    animation: livePulse 1.8s infinite ease-in-out;
}

@keyframes livePulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(2.6); opacity: 0; }
}

/* ============================================= */
/* == 8. RESPONSIVE                           == */
/* ============================================= */

@media (max-width: 850px) {
    .comisiones-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .comisiones-container {
        padding: 20px 12px 40px;
    }

    .contact-method-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .form-card, .status-card, .historial-card {
        padding: 1.5rem 1.25rem;
    }
}

/* ============================================= */
/* == 9. REDUCED MOTION                       == */
/* ============================================= */

@media (prefers-reduced-motion: reduce) {
    .form-card,
    .status-card,
    .historial-card,
    .btn-submit,
    .status-link::after,
    .contact-method-option,
    .form-group input,
    .form-group textarea,
    .form-group select,
    .form-control {
        transition: none;
    }

    .form-card:hover,
    .status-card:hover,
    .historial-card:hover,
    .btn-submit:hover {
        transform: none;
    }

    .live-activity-badge .pulse-dot::after {
        animation: none;
        opacity: 0.5;
    }
}