/* ============================================================
   Tile Refresh AI Widget
   ============================================================ */

.tr-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
    color: #1a1a1a;
}

.tr-hidden { display: none !important; }

/* ---- Buttons ---- */
.tr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
}
.tr-btn:hover  { opacity: 0.88; }
.tr-btn:active { transform: scale(0.97); }

.tr-btn-primary {
    background: #c8a96e;   /* gold — matches tiling brand */
    color: #fff;
}
.tr-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

/* ---- Upload zone ---- */
.tr-upload-zone {
    border: 2px dashed #d0c4b0;
    border-radius: 16px;
    padding: 60px 24px;
    text-align: center;
    background: #faf8f5;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.tr-upload-zone.tr-drag-over {
    border-color: #c8a96e;
    background: #fdf6ec;
}
.tr-upload-icon svg {
    width: 52px;
    height: 52px;
    color: #c8a96e;
    margin-bottom: 16px;
}
.tr-upload-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}
.tr-upload-hint {
    font-size: 13px;
    color: #888;
    margin: 0 0 24px;
}

/* ---- Processing ---- */
.tr-processing {
    text-align: center;
    padding: 80px 24px;
}
.tr-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #e8e0d4;
    border-top-color: #c8a96e;
    border-radius: 50%;
    animation: tr-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }

#tr-status-text {
    font-size: 16px;
    color: #555;
    margin: 0;
}

/* ---- Result ---- */
.tr-comparison {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}
.tr-panel {
    flex: 1;
    position: relative;
}
.tr-panel img {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.tr-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.tr-divider {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding-top: 40%;
    color: #c8a96e;
}
.tr-divider svg {
    width: 28px;
    height: 28px;
}

.tr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tr-prompt-text {
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    margin: 0;
}

/* ---- Error ---- */
.tr-error {
    text-align: center;
    padding: 60px 24px;
    background: #fff5f5;
    border-radius: 16px;
    border: 1px solid #fecaca;
}
.tr-error p {
    color: #b91c1c;
    font-size: 15px;
    margin: 0 0 20px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .tr-comparison { flex-direction: column; }
    .tr-divider     { display: none; }
    .tr-actions     { flex-direction: column; }
    .tr-btn         { width: 100%; }
}
