/**
 * Testimonial Form Styles
 *
 * @package LDStarter
 * @subpackage Testimonials
 */

/* ==========================================================================
   Form Container (inherits from lds-form)
   ========================================================================== */

.lds-testimonial-form {
    max-width: 600px;
}

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.lds-rating-stars {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.lds-rating-stars__star {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s ease, transform 0.15s ease;
    outline-offset: 2px;
}

.lds-rating-stars__star:hover {
    transform: scale(1.15);
}

.lds-rating-stars__star:focus {
    outline: 2px solid var(--color-primary, #3B82F6);
    border-radius: 4px;
}

.lds-rating-stars__star.active {
    color: #ffb900;
}

.lds-rating-stars__star:hover,
.lds-rating-stars__star:hover ~ .lds-rating-stars__star {
    color: #ddd;
}

.lds-rating-stars:hover .lds-rating-stars__star {
    color: #ffb900;
}

.lds-rating-stars:hover .lds-rating-stars__star:hover ~ .lds-rating-stars__star {
    color: #ddd;
}

.lds-rating-stars__icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
    display: block;
}

/* ==========================================================================
   File Upload Preview
   ========================================================================== */

.lds-form__file-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lds-form__file-preview {
    position: relative;
    display: inline-block;
    max-width: 150px;
}

.lds-form__file-preview img {
    display: block;
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
}

.lds-form__file-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    background: #d63638;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lds-form__file-remove:hover {
    background: #b32d2e;
    transform: scale(1.1);
}

/* ==========================================================================
   Messages
   ========================================================================== */

.lds-form__messages {
    display: none;
    padding: 14px 18px;
    border-radius: 6px;
    margin-top: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.lds-form__messages--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lds-form__messages--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.lds-form__messages--info {
    background: #e7f3ff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

/* ==========================================================================
   Submit Button States
   ========================================================================== */

.lds-form__submit--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.lds-form__submit--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: lds-spin 0.8s linear infinite;
}

@keyframes lds-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Help Text
   ========================================================================== */

.lds-form__help {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* ==========================================================================
   No-JS Fallback
   ========================================================================== */

noscript .lds-form__select {
    width: 100%;
    max-width: 300px;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
}

/* Hide JS stars when no JS (they won't work anyway) */
.no-js .lds-rating-stars {
    display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 640px) {
    .lds-rating-stars__icon {
        width: 36px;
        height: 36px;
    }

    .lds-rating-stars__star {
        padding: 2px;
    }

    .lds-form__file-preview img {
        max-width: 120px;
        max-height: 120px;
    }
}
