/* Appraizely Embeddable Widget Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #1A1A1A;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.apzl-widget {
    max-width: 100%;
    padding: 16px;
    min-height: 100%;
}

/* Header */
.apzl-widget-header {
    text-align: center;
    padding: 12px 0 16px;
    border-bottom: 2px solid #E8F0F8;
    margin-bottom: 16px;
}

.apzl-widget-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: #0B3D6B;
    margin: 0 0 4px;
}

.apzl-widget-header p {
    font-size: 12px;
    color: #888888;
    margin: 0;
}

/* Upload Area */
.apzl-widget-upload {
    border: 2px dashed #E0E0E0;
    border-radius: 10px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #F7F7F7;
    margin-bottom: 12px;
}

.apzl-widget-upload:hover,
.apzl-widget-upload.drag-over {
    border-color: #B8860B;
    background: #FDF6E3;
}

.apzl-widget-upload i {
    font-size: 32px;
    color: #B8860B;
    display: block;
    margin-bottom: 8px;
}

.apzl-widget-upload .upload-title {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.apzl-widget-upload .upload-hint {
    font-size: 11px;
    color: #888888;
}

/* Image Preview */
.apzl-widget-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.apzl-widget-preview .preview-thumb {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #E0E0E0;
}

.apzl-widget-preview .preview-item {
    position: relative;
}

.apzl-widget-preview .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #B83230;
    color: #fff;
    border: none;
    font-size: 10px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

/* Optional Fields */
.apzl-widget-fields {
    margin-bottom: 12px;
}

.apzl-widget-toggle {
    font-size: 12px;
    color: #0B3D6B;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.apzl-widget-toggle:hover {
    color: #082D4F;
}

.apzl-widget-fields .field-group {
    margin-bottom: 8px;
}

.apzl-widget-fields label {
    font-size: 11px;
    font-weight: 600;
    color: #555555;
    display: block;
    margin-bottom: 3px;
}

.apzl-widget-fields input,
.apzl-widget-fields select,
.apzl-widget-fields textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #1A1A1A;
    background: #fff;
    transition: border-color 0.2s;
}

.apzl-widget-fields input:focus,
.apzl-widget-fields select:focus,
.apzl-widget-fields textarea:focus {
    outline: none;
    border-color: #0B3D6B;
    box-shadow: 0 0 0 2px rgba(11, 61, 107, 0.1);
}

.apzl-widget-fields textarea {
    resize: vertical;
    min-height: 50px;
}

/* Submit Button */
.apzl-widget-submit {
    width: 100%;
    padding: 12px;
    background: #B8860B;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.apzl-widget-submit:hover {
    background: #966E09;
}

.apzl-widget-submit:disabled {
    background: #E0E0E0;
    color: #888888;
    cursor: not-allowed;
}

/* Loading State */
.apzl-widget-loading {
    display: none;
    text-align: center;
    padding: 32px 16px;
}

.apzl-widget-loading.active {
    display: block;
}

.apzl-widget-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E8F0F8;
    border-top: 3px solid #0B3D6B;
    border-radius: 50%;
    animation: apzl-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

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

.apzl-widget-loading p {
    font-size: 13px;
    color: #555555;
    margin: 4px 0 0;
}

.apzl-widget-loading .loading-sub {
    font-size: 11px;
    color: #888888;
}

/* Result */
.apzl-widget-result {
    display: none;
    text-align: center;
    padding: 16px 0;
}

.apzl-widget-result.active {
    display: block;
}

.apzl-widget-result .result-icon {
    font-size: 36px;
    color: #1A7A3D;
    margin-bottom: 8px;
}

.apzl-widget-result .result-title {
    font-size: 16px;
    font-weight: 700;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.apzl-widget-result .result-value {
    font-size: 28px;
    font-weight: 700;
    color: #0B3D6B;
    margin: 12px 0;
}

.apzl-widget-result .result-desc {
    font-size: 12px;
    color: #555555;
    margin-bottom: 16px;
    line-height: 1.5;
}

.apzl-widget-result .result-link {
    display: inline-block;
    padding: 10px 20px;
    background: #0B3D6B;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.apzl-widget-result .result-link:hover {
    background: #082D4F;
}

.apzl-widget-result .result-reset {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: #0B3D6B;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
}

/* Error */
.apzl-widget-error {
    background: #fef2f2;
    border: 1px solid #B83230;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
    color: #B83230;
    margin-bottom: 12px;
    display: none;
}

.apzl-widget-error.active {
    display: block;
}

/* Footer */
.apzl-widget-footer {
    text-align: center;
    padding: 12px 0 4px;
    margin-top: 12px;
    border-top: 1px solid #E8F0F8;
}

.apzl-widget-footer a {
    font-size: 11px;
    color: #888888;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.apzl-widget-footer a:hover {
    color: #0B3D6B;
}

.apzl-widget-footer .footer-logo {
    width: 14px;
    height: 14px;
}

/* Rate Limit */
.apzl-widget-ratelimit {
    background: #FDF6E3;
    border: 1px solid #B8860B;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    display: none;
}

.apzl-widget-ratelimit.active {
    display: block;
}

.apzl-widget-ratelimit p {
    font-size: 13px;
    color: #555555;
    margin: 0 0 8px;
}

.apzl-widget-ratelimit a {
    font-size: 13px;
    font-weight: 600;
    color: #0B3D6B;
}
