/* ─── Reset & base ─────────────────────────────────────────────────────────── */
.ygee-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #111;
    box-sizing: border-box;
}

.ygee-content {
    background: #fff;
    border-radius: 14px;
    padding: 36px 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.06);
}

/* ─── Titolo ────────────────────────────────────────────────────────────────── */
.ygee-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 6px;
    color: #111;
}

.ygee-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* ─── Drop zone ─────────────────────────────────────────────────────────────── */
.ygee-drop-zone {
    border: 1.5px dashed #d0d0d0;
    border-radius: 12px;
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: center;
    margin-bottom: 24px;
}

.ygee-drop-zone:hover,
.ygee-drop-zone.ygee-drag-over {
    background: #f9f9f9;
    border-color: #999;
}

.ygee-drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-bottom: 4px;
}

.ygee-drop-label { font-size: 0.95rem; font-weight: 600; color: #222; margin: 0; }
.ygee-drop-hint  { font-size: 0.8rem; color: #999; margin: 0; }

.ygee-drop-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 220px;
    margin: 4px 0;
}

.ygee-drop-divider hr   { flex: 1; border: none; border-top: 1px solid #e0e0e0; margin: 0; }
.ygee-drop-divider span { font-size: 0.78rem; color: #bbb; }

.ygee-btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
}

.ygee-btn-upload:hover { opacity: 0.82; }

/* ─── Feature strip ─────────────────────────────────────────────────────────── */
.ygee-feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.ygee-feat {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f7f7f7;
    border-radius: 10px;
    padding: 12px 14px;
}

.ygee-feat svg    { color: #555; flex-shrink: 0; margin-top: 1px; }
.ygee-feat div    { display: flex; flex-direction: column; gap: 2px; }
.ygee-feat strong { font-size: 0.82rem; font-weight: 600; color: #111; }
.ygee-feat span   { font-size: 0.78rem; color: #888; line-height: 1.4; }

/* ─── Messaggi ──────────────────────────────────────────────────────────────── */
#ygee-error-message,
#ygee-success-message,
#ygee-loader { display: none; }

.ygee-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 0 0 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

.ygee-error   { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.ygee-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }

/* ─── Loader ────────────────────────────────────────────────────────────────── */
.ygee-loader {
    text-align: center;
    padding: 32px;
    color: #888;
    font-size: 0.875rem;
}

.ygee-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #111;
    border-radius: 50%;
    animation: ygee-spin 0.8s linear infinite;
    margin: 0 auto 14px;
}

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

/* ─── Editor layout ─────────────────────────────────────────────────────────── */
.ygee-editor-layout {
    display: none;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 20px;
    align-items: start;
}

.ygee-editor-layout.is-visible { display: grid; }

/* ── Colonna anteprima ── */
.ygee-preview-col { display: flex; flex-direction: column; gap: 10px; }

.ygee-group-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #888;
    margin: 0;
}

.ygee-img-box {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ygee-img-box img {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    display: block;
}

.ygee-img-meta {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.75rem;
    color: #666;
    line-height: 1.8;
}

.ygee-img-meta strong { color: #111; font-weight: 600; }

/* ── Colonna form ── */
.ygee-form-col { display: flex; flex-direction: column; gap: 0; }

/* ─── Tab bar ────────────────────────────────────────────────────────────────── */
.ygee-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 20px;
}

.ygee-tab {
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #888;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color .12s, border-color .12s;
    margin-bottom: -2px;
}

.ygee-tab:hover   { color: #333; }
.ygee-tab.active  { color: #111; border-bottom-color: #111; }

/* ─── Tab panel ─────────────────────────────────────────────────────────────── */
.ygee-tab-panel { display: none; }
.ygee-tab-panel.active { display: block; }

.ygee-field-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ygee-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ygee-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ygee-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
}

.ygee-input,
.ygee-select,
.ygee-textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #111;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.ygee-input:focus,
.ygee-select:focus,
.ygee-textarea:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 3px rgba(0,0,0,.07);
}

.ygee-textarea { resize: vertical; min-height: 72px; }

/* ─── GPS note ───────────────────────────────────────────────────────────────── */
.ygee-gps-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.5;
}

.ygee-gps-note svg { flex-shrink: 0; margin-top: 1px; }

/* ─── Preset chips GPS ──────────────────────────────────────────────────────── */
.ygee-preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ygee-preset-chip {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 99px;
    border: 1px solid #e0e0e0;
    background: #f7f7f7;
    color: #444;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}

.ygee-preset-chip:hover { background: #efefef; border-color: #ccc; }

.ygee-preset-chip:last-child {
    border-color: #fed7d7;
    background: #fff5f5;
    color: #c53030;
}

.ygee-preset-chip:last-child:hover { background: #fed7d7; }

/* ─── Custom fields ─────────────────────────────────────────────────────────── */
.ygee-custom-desc {
    font-size: 0.82rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.ygee-custom-desc code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #333;
}

#ygee-custom-fields { display: flex; flex-direction: column; gap: 8px; }

.ygee-custom-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    align-items: center;
}

.ygee-remove-field {
    width: 30px;
    height: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #c53030;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .12s;
}

.ygee-remove-field:hover { background: #fff5f5; border-color: #fed7d7; }

.ygee-add-field-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: #f7f7f7;
    border: 1.5px dashed #d0d0d0;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: background .12s, border-color .12s;
    width: 100%;
    justify-content: center;
}

.ygee-add-field-btn:hover { background: #f0f0f0; border-color: #bbb; }

/* ─── Toolbar ───────────────────────────────────────────────────────────────── */
.ygee-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 24px;
}

.ygee-secondary-button,
.ygee-primary-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, opacity .12s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.ygee-secondary-button {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #444;
}

.ygee-secondary-button:hover:not(:disabled) { background: #ebebeb; }

.ygee-primary-button {
    background: #111;
    color: #fff;
    border-color: #111;
    flex: 1;
    justify-content: center;
}

.ygee-primary-button:hover:not(:disabled) { opacity: .82; }

.ygee-secondary-button:disabled,
.ygee-primary-button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ─── Istruzioni ────────────────────────────────────────────────────────────── */
.ygee-instructions {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 8px;
}

.ygee-instructions strong {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    display: block;
    margin-bottom: 10px;
}

.ygee-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ygee-instructions li { display: flex; gap: 10px; font-size: 0.82rem; color: #666; }
.ygee-instructions li span { font-weight: 600; color: #333; min-width: 60px; }

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.ygee-footer {
    text-align: center;
    padding-top: 24px;
    margin-top: 32px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.78rem;
    color: #bbb;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .ygee-content        { padding: 24px 20px; }
    .ygee-feature-strip  { grid-template-columns: 1fr; }
    .ygee-editor-layout  { grid-template-columns: 1fr; }
    .ygee-field-row      { grid-template-columns: 1fr; }
    .ygee-custom-row     { grid-template-columns: 1fr 1fr auto; }
    .ygee-toolbar        { flex-direction: column; }
    .ygee-toolbar button { width: 100%; justify-content: center; }
}
