/* ==========================================================================
   GSC Soddisfazione Cliente – Frontend Styles
   Segue le convenzioni di aryanna-archive-table.php
   ========================================================================== */

/* --------------------------------------------------------------------------
   Messaggi (successo / errore)
   -------------------------------------------------------------------------- */
.gsc-message {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}
.gsc-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.gsc-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* --------------------------------------------------------------------------
   Form inserimento contributo
   -------------------------------------------------------------------------- */
.gsc-form-wrapper {
    max-width: 820px;
}

.gsc-field-group {
    margin-bottom: 22px;
}

.gsc-label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 7px;
    color: #1d2327;
}

.gsc-required {
    color: #dc3545;
}

.gsc-input,
.gsc-select,
.gsc-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #dfe5ef;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #333;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    appearance: auto;
}

.gsc-input:focus,
.gsc-select:focus,
.gsc-textarea:focus {
    outline: none;
    border-color: #003c97;
    box-shadow: 0 0 0 3px rgba(0, 60, 151, 0.12);
}

.gsc-input-readonly {
    background: #f5f7fb;
    color: #667085;
    cursor: not-allowed;
}

.gsc-textarea {
    resize: vertical;
    min-height: 150px;
}

.gsc-char-counter {
    text-align: right;
    font-size: 11px;
    color: #667085;
    margin-top: 5px;
}

.gsc-chars-warning {
    color: #dc3545;
    font-weight: 700;
}

.gsc-field-note {
    font-size: 11px;
    color: #667085;
    margin: 5px 0 0;
}

.gsc-label-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.5;
}

.gsc-label-checkbox .gsc-checkbox {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.gsc-form-actions {
    margin-top: 30px;
}

/* Pulsanti */
.gsc-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 150ms ease, opacity 150ms ease;
    line-height: 1.4;
}

.gsc-btn-submit  { background: #003c97; color: #fff; }
.gsc-btn-submit:hover  { background: #002d73; color: #fff; }

.gsc-btn-approve { background: #28a745; color: #fff; }
.gsc-btn-approve:hover { background: #218838; color: #fff; }

.gsc-btn-reject  { background: #dc3545; color: #fff; }
.gsc-btn-reject:hover  { background: #c82333; color: #fff; }

.gsc-btn-edit    { background: #6c757d; color: #fff; }
.gsc-btn-edit:hover    { background: #5a6268; color: #fff; }

/* --------------------------------------------------------------------------
   Barra filtri categoria
   -------------------------------------------------------------------------- */
.gsc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}

.gsc-filter-btn {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f7;
    color: #333;
    text-decoration: none;
    border: 1px solid #e0e3eb;
    transition: background 150ms, color 150ms, border-color 150ms;
    white-space: nowrap;
}

.gsc-filter-btn:hover {
    background: #e0e3eb;
    color: #111;
    text-decoration: none;
}

.gsc-filter-btn.active {
    background: #003c97;
    color: #fff;
    border-color: #003c97;
}

/* --------------------------------------------------------------------------
   Archivio – tabella contributi approvati
   -------------------------------------------------------------------------- */
.gsc-archivio-wrapper,
.gsc-gestione-wrapper {
    padding: 0 0 32px;
}

.gsc-archivio-table-box,
.gsc-gestione-table-box {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e0e3eb;
    overflow: hidden;
}

.gsc-archivio-table,
.gsc-gestione-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    line-height: 1.5;
}

.gsc-archivio-table thead,
.gsc-gestione-table thead {
    background: #f3f4f7;
}

.gsc-archivio-table th,
.gsc-gestione-table th,
.gsc-archivio-table td,
.gsc-gestione-table td {
    padding: 11px 18px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.gsc-archivio-table th,
.gsc-gestione-table th {
    font-weight: 700;
    white-space: nowrap;
    color: #1d2327;
}

.gsc-col-testo {
    width: 55%;
}

.gsc-col-testo a {
    font-family: "Work Sans", sans-serif;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    color: #003c97;
    font-size: 13px;
}

.gsc-col-testo a:hover {
    color: #002d73;
}

.gsc-col-categoria {
    white-space: normal;
    min-width: 120px;
}

.gsc-col-data {
    white-space: nowrap;
    color: #667085;
    font-size: 12px;
}

/* Pill categoria */
.gsc-cat-pill {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #c7e400;
    color: #000;
    white-space: nowrap;
    margin-right: 4px;
    margin-bottom: 3px;
}

/* Campo ricerca nel th */
.gsc-th-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gsc-th-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.gsc-search-field {
    position: relative;
    flex: 0 1 360px;
    min-width: 200px;
}

.gsc-search-input {
    width: 100% !important;
    box-sizing: border-box !important;
    height: 36px !important;
    border-radius: 9999px !important;
    border: 1px solid #dfe5ef !important;
    padding: 0 38px 0 38px !important;
    font-size: 12px !important;
    font-family: inherit !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: 12px 50% !important;
    background-size: 16px 16px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 18 18'%3E%3Ccircle cx='8' cy='8' r='5' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3Cline x1='12' y1='12' x2='16' y2='16' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06) !important;
    color: #333 !important;
    transition: border-color 150ms !important;
}

.gsc-search-input::placeholder {
    color: #aaa !important;
}

.gsc-search-input:focus {
    outline: none !important;
    border-color: #003c97 !important;
    box-shadow: 0 0 0 3px rgba(0, 60, 151, 0.12) !important;
}

.gsc-search-clear {
    position: absolute !important;
    right: 9px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: none;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 16px !important;
    line-height: 1 !important;
    color: #aaa !important;
    cursor: pointer !important;
}

.gsc-search-clear:hover {
    color: #333 !important;
}

.gsc-no-results {
    padding: 28px 20px;
    color: #667085;
    text-align: center;
    font-style: italic;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Pannello Gestione – tab navigazione
   -------------------------------------------------------------------------- */
.gsc-gestione-note {
    font-size: 13px;
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 18px;
}

.gsc-gestione-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e3eb;
}

.gsc-tab {
    display: inline-block;
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #667085;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 150ms, border-color 150ms;
}

.gsc-tab:hover {
    color: #333;
    text-decoration: none;
}

.gsc-tab.active {
    color: #003c97;
    border-bottom-color: #003c97;
}

.gsc-col-azioni {
    white-space: nowrap;
    min-width: 200px;
}

.gsc-col-azioni .gsc-btn {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Badge stato (admin columns) */
.gsc-stato-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.gsc-stato-pending      { background: #fff3cd; color: #856404; }
.gsc-stato-publish      { background: #d4edda; color: #155724; }
.gsc-stato-gsc_rejected { background: #f8d7da; color: #721c24; }
.gsc-stato-draft        { background: #e9ecef; color: #495057; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .gsc-search-field { flex: 0 1 260px; min-width: 160px; }
}

@media (max-width: 768px) {
    .gsc-archivio-table-box,
    .gsc-gestione-table-box { border-radius: 0; }

    .gsc-archivio-table th,
    .gsc-gestione-table th,
    .gsc-archivio-table td,
    .gsc-gestione-table td { padding: 9px 12px; font-size: 12px; }

    /* Nasconde colonna data su mobile */
    .gsc-archivio-table .gsc-col-data,
    .gsc-gestione-table .gsc-col-data { display: none; }

    .gsc-th-wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
    .gsc-search-field { width: 100%; max-width: 100%; }

    .gsc-filter-bar { gap: 6px; }
    .gsc-filter-btn { padding: 5px 12px; font-size: 11px; }

    .gsc-gestione-tabs { overflow-x: auto; }
    .gsc-tab { padding: 9px 14px; font-size: 12px; }

    .gsc-col-azioni { white-space: normal; }
}
