/**
 * Moto Finder - Frontend Styles
 *
 * Questo file può essere modificato liberamente.
 * I colori usano variabili CSS definite dinamicamente dal plugin.
 *
 * @package Moto_Finder
 */

/* ==========================================================================
   VARIABILI CSS (valori di fallback)
   ========================================================================== */

:root {
    --mf-color-primary: #000000;
    --mf-color-primary-hover: #194182;
    --mf-color-text: #333333;
    --mf-color-text-light: #666666;
    --mf-color-border: #dddddd;
    --mf-color-background: #f5f5f5;
    --mf-color-background-active: #eaeef5;
    --mf-color-accent: #194182;
}

/* ==========================================================================
   FINDER STANDARD [moto_finder]
   ========================================================================== */

.mf-finder {
    background: var(--mf-color-background);
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.mf-finder__title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--mf-color-text);
    line-height: 1.4;
    text-align: center;
}

.mf-finder__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.mf-finder--horizontal .mf-finder__field {
    flex: 1;
    min-width: 160px;
}

.mf-finder--horizontal .mf-finder__field--button {
    flex: 0 0 auto;
    min-width: auto;
}

.mf-finder--vertical .mf-finder__fields {
    flex-direction: column;
}

.mf-finder--vertical .mf-finder__field {
    width: 100%;
}

.mf-finder__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mf-finder__field label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mf-color-text);
    line-height: 1.4;
}

.mf-finder__select {
    width: 100%;
    height: 40px;
    padding: 0 30px 0 12px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mf-color-text);
    border: 1px solid var(--mf-color-border);
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23333' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
}

.mf-finder__select:focus {
    outline: none;
    border-color: var(--mf-color-accent);
}

.mf-finder__select:disabled {
    background-color: #fafafa;
    color: #aaa;
    cursor: default;
}

.mf-finder__button {
    width: 100%;
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: #fff;
    background: var(--mf-color-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mf-finder__button:hover:not(:disabled) {
    background: var(--mf-color-primary-hover);
}

.mf-finder__button:disabled {
    background: #ccc;
    cursor: default;
}

/* Filtro Attivo */
.mf-finder__active-filter {
    background: var(--mf-color-background-active);
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.mf-finder__active-filter-text {
    color: var(--mf-color-text);
}

.mf-finder__active-filter-text strong {
    font-weight: 600;
    color: var(--mf-color-accent);
}

.mf-finder__clear-link {
    color: var(--mf-color-text-light);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.mf-finder__clear-link:hover {
    color: var(--mf-color-accent);
}

/* Responsive */
@media (max-width: 768px) {
    .mf-finder--horizontal .mf-finder__fields {
        flex-direction: column;
    }

    .mf-finder--horizontal .mf-finder__field {
        width: 100%;
        min-width: 100%;
    }
}

/* ==========================================================================
   FINDER COMPATTO [moto_finder_compact]
   ========================================================================== */

.mf-compact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.mf-compact__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--mf-color-text);
    line-height: 1.4;
}

.mf-compact select {
    height: 40px;
    padding: 0 30px 0 12px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mf-color-text);
    border: 1px solid var(--mf-color-border);
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23333' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
    min-width: 130px;
}

.mf-compact select:focus {
    outline: none;
    border-color: var(--mf-color-accent);
}

.mf-compact select:disabled {
    background-color: #fafafa;
    color: #aaa;
    cursor: default;
}

.mf-compact__btn {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: #fff;
    background: var(--mf-color-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mf-compact__btn:hover:not(:disabled) {
    background: var(--mf-color-primary-hover);
}

.mf-compact__btn:disabled {
    background: #ccc;
    cursor: default;
}

.mf-compact__active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    background: var(--mf-color-background);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mf-color-text);
}

.mf-compact__active strong {
    font-weight: 600;
}

.mf-compact__btn--clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    background: none;
    border: 1px solid var(--mf-color-border);
    border-radius: 4px;
    color: var(--mf-color-text-light);
    font-size: 14px;
    line-height: 40px;
    cursor: pointer;
    text-decoration: none;
}

.mf-compact__btn--clear:hover {
    border-color: var(--mf-color-accent);
    color: var(--mf-color-accent);
}

/* Versione Dark */
.mf-compact--dark .mf-compact__label {
    color: #fff;
}

.mf-compact--dark select {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23fff' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
}

.mf-compact--dark select:hover {
    border-color: rgba(255, 255, 255, 0.7);
}

.mf-compact--dark select:focus {
    border-color: #fff;
}

.mf-compact--dark select:disabled {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
}

.mf-compact--dark select option {
    background: #194182;
    color: #fff;
}

.mf-compact--dark .mf-compact__btn {
    background: #fff;
    color: #194182;
}

.mf-compact--dark .mf-compact__btn:hover:not(:disabled) {
    background: #eaeef5;
}

.mf-compact--dark .mf-compact__btn:disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.mf-compact--dark .mf-compact__active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.mf-compact--dark .mf-compact__active strong {
    color: #fff;
}

.mf-compact--dark .mf-compact__btn--clear {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: transparent;
}

.mf-compact--dark .mf-compact__btn--clear:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ==========================================================================
   FINDER MODAL [moto_finder_modal]
   ========================================================================== */

.mf-modal-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    color: #fff;
    background: var(--mf-color-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mf-modal-trigger:hover {
    background: var(--mf-color-primary-hover);
}

.mf-modal-trigger--dark {
    background: #fff;
    color: #194182;
}

.mf-modal-trigger--dark:hover {
    background: #eaeef5;
}

/* Stato selezionato */
.mf-modal-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}

.mf-modal-selected__label {
    color: var(--mf-color-text-light);
}

.mf-modal-selected__value {
    color: var(--mf-color-accent);
    font-weight: 600;
}

.mf-modal-selected__edit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: var(--mf-color-text-light);
    background: none;
    border: 1px solid var(--mf-color-border);
    border-radius: 4px;
    cursor: pointer;
}

.mf-modal-selected__edit:hover {
    border-color: var(--mf-color-accent);
    color: var(--mf-color-accent);
}

.mf-modal-selected__edit svg {
    flex-shrink: 0;
}

/* Versione dark selezionato */
.mf-modal-selected--dark .mf-modal-selected__label {
    color: #fff;
}

.mf-modal-selected--dark .mf-modal-selected__value {
    color: #fff;
}

.mf-modal-selected--dark .mf-modal-selected__edit {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: transparent;
}

.mf-modal-selected--dark .mf-modal-selected__edit:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Modal Overlay */
.mf-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mf-modal-overlay.mf-modal-active {
    display: flex;
}

body.mf-modal-open {
    overflow: hidden;
}

.mf-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.mf-modal__header {
    position: relative;
    padding: 16px 50px 16px 20px;
    border-bottom: 1px solid #eee;
}

.mf-modal__title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--mf-color-text);
    margin: 0;
    line-height: 1.4;
}

.mf-modal__subtitle {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
}

.mf-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    border-radius: 4px;
}

.mf-modal__close:hover {
    background: var(--mf-color-background);
    color: var(--mf-color-text);
}

.mf-modal__body {
    padding: 20px;
}

.mf-modal__field {
    margin-bottom: 16px;
}

.mf-modal__field:last-child {
    margin-bottom: 0;
}

.mf-modal__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--mf-color-text-light);
    margin-bottom: 6px;
    line-height: 1.4;
}

.mf-modal__select {
    width: 100%;
    height: 44px;
    padding: 0 36px 0 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mf-color-text);
    border: 1px solid var(--mf-color-border);
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23333' d='M0 0h10L5 6z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
}

.mf-modal__select:focus {
    outline: none;
    border-color: var(--mf-color-accent);
}

.mf-modal__select:disabled {
    background-color: #fafafa;
    color: #aaa;
    cursor: default;
}

.mf-modal__footer {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.mf-modal__btn {
    flex: 1;
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.mf-modal__btn--primary {
    background: var(--mf-color-primary);
    color: #fff;
}

.mf-modal__btn--primary:hover:not(:disabled) {
    background: var(--mf-color-primary-hover);
}

.mf-modal__btn--primary:disabled {
    background: #ccc;
    cursor: default;
}

.mf-modal__btn--secondary {
    background: var(--mf-color-background);
    color: var(--mf-color-text);
}

.mf-modal__btn--secondary:hover {
    background: #eee;
}

.mf-modal__active {
    padding: 16px 20px;
    background: var(--mf-color-background);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mf-modal__active-text {
    font-size: 14px;
    line-height: 1.4;
    color: var(--mf-color-text);
}

.mf-modal__active-text strong {
    color: var(--mf-color-accent);
    font-weight: 600;
}

.mf-modal__active-clear {
    font-size: 13px;
    color: var(--mf-color-text-light);
    text-decoration: none;
    white-space: nowrap;
}

.mf-modal__active-clear:hover {
    color: #c00;
}
