/* ============================================
   AI Travel Assistant — Stile widget
   ============================================ */

.ata-widget {
    --ata-primary: #1a6b4a;
    --ata-text: #ffffff;
    --ata-radius: 16px;
    --ata-shadow: 0 2px 24px rgba(0,0,0,0.08);
    font-family: 'Georgia', 'Times New Roman', serif;
    max-width: 680px;
    margin: 2rem auto;
    background: #fff;
    border-radius: var(--ata-radius);
    box-shadow: var(--ata-shadow);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Header */
.ata-header {
    background: var(--ata-primary);
    padding: 2rem 2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    color: var(--ata-text);
}

.ata-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.9;
}

.ata-title {
    font-size: 1.35rem;
    font-weight: normal;
    margin: 0 0 0.3rem;
    color: var(--ata-text);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.ata-subtitle {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.82;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-style: italic;
}

/* Progress bar */
.ata-progress {
    background: rgba(0,0,0,0.07);
    height: 3px;
    border-radius: 0;
    overflow: hidden;
}

.ata-bar {
    height: 100%;
    background: var(--ata-primary);
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

/* Step container */
.ata-step {
    padding: 1.75rem 2rem;
}

#ata-step-1 { padding-top: 0; }
#ata-step-1 .ata-header { margin: 0 -0px; border-radius: 0; }
#ata-step-1 .ata-progress { margin: 0; }
#ata-step-1 .ata-question { margin-top: 1.5rem; }

.ata-step.hidden {
    display: none;
}

/* Question */
.ata-question {}

.ata-q-label {
    font-size: 1.05rem;
    font-weight: normal;
    color: #1a1a1a;
    margin: 0 0 1rem;
    font-family: 'Georgia', serif;
    letter-spacing: -0.01em;
}

.ata-q-sub {
    font-size: 0.8rem;
    color: #888;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: italic;
}

/* Pills */
.ata-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.ata-pill {
    background: #f8f8f6;
    border: 1px solid #e0ddd8;
    border-radius: 40px;
    padding: 9px 18px;
    font-size: 0.875rem;
    cursor: pointer;
    color: #3a3a3a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    transition: all 0.15s ease;
    line-height: 1;
}

.ata-pill:hover {
    background: #f0ede8;
    border-color: #c5c0b8;
}

.ata-pill.selected {
    background: var(--ata-primary);
    border-color: var(--ata-primary);
    color: #fff;
}

/* Buttons */
.ata-btn-next,
.ata-btn-submit {
    background: var(--ata-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.01em;
}

.ata-btn-next:hover,
.ata-btn-submit:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.ata-btn-next:disabled,
.ata-btn-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.ata-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.ata-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ata-primary);
    border-radius: 50%;
    animation: ata-spin 0.8s linear infinite;
    margin: 0 auto 1.25rem;
}

@keyframes ata-spin {
    to { transform: rotate(360deg); }
}

.ata-loading-text {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    font-family: 'Georgia', serif;
    margin: 0;
}

/* Results */
.ata-results-header {
    background: var(--ata-primary);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--ata-text);
    margin: -1.75rem -2rem 1.75rem;
}

#ata-step-results { padding-top: 1.75rem; }

.ata-itinerario-box {
    background: #f9f7f4;
    border-left: 3px solid var(--ata-primary);
    border-radius: 0 8px 8px 0;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: #2a2a2a;
    font-family: 'Georgia', serif;
    font-style: italic;
}

.ata-results-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    font-family: -apple-system, sans-serif;
    font-weight: 500;
    margin: 0 0 1rem;
}

/* Cards */
.ata-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 1.75rem;
}

.ata-card {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ata-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.ata-card-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    background: #f0ede8;
}

.ata-card-img-placeholder {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, #f0ede8 0%, #e8e3dc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.ata-card-body {
    padding: 12px 14px;
}

.ata-card-categoria {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ata-primary);
    font-weight: 600;
    font-family: -apple-system, sans-serif;
    margin-bottom: 4px;
}

.ata-card-titolo {
    font-size: 0.9rem;
    font-family: 'Georgia', serif;
    color: #1a1a1a;
    margin: 0 0 6px;
    line-height: 1.35;
}

.ata-card-motivo {
    font-size: 0.78rem;
    color: #888;
    font-family: -apple-system, sans-serif;
    line-height: 1.4;
    margin: 0;
}

/* Reset button */
.ata-btn-reset {
    background: transparent;
    border: 1px solid #d0ccc7;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    font-family: -apple-system, sans-serif;
    transition: all 0.15s;
}

.ata-btn-reset:hover {
    background: #f5f3f0;
    border-color: #b0aba5;
}

/* Error */
.ata-error-box {
    text-align: center;
    padding: 2rem;
}

.ata-error-text {
    color: #c0392b;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 600px) {
    .ata-widget {
        margin: 0.5rem;
        border-radius: 12px;
    }
    .ata-header,
    .ata-step {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    .ata-results-header {
        margin-left: -1.25rem;
        margin-right: -1.25rem;
    }
    .ata-cards-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .ata-cards-grid {
        grid-template-columns: 1fr;
    }
}
