/* ================================================
   TESTIMONIAL FORM STYLING - ENHANCED
   Attractive modern design with woodworking theme
   ================================================ */

/* Main form container */
#testimonialForm {
    background: linear-gradient(145deg, #EAC796 0%, #d4b488 50%, #cfaa79 100%);
    border: 2px solid rgba(45, 30, 23, 0.2);
    border-radius: 0.75rem;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    /* Add padding so fields don't touch sides */
    padding: 2rem 2.5rem 2rem 2.5rem;
}

/* Decorative corner accents */
#testimonialForm::before,
#testimonialForm::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(45, 30, 23, 0.15);
    transition: all 0.4s ease;
}

#testimonialForm::before {
    top: 10px;
    left: 10px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 0.5rem;
}

#testimonialForm::after {
    bottom: 10px;
    right: 10px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 0.5rem;
}

#testimonialForm:hover {
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    transform: translateY(-4px);
}

#testimonialForm:hover::before,
#testimonialForm:hover::after {
    border-color: rgba(45, 30, 23, 0.3);
    width: 100px;
    height: 100px;
}

/* ================================================
   CHARACTER COUNTER STYLES
   ================================================ */

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    font-family: 'Tajawal', sans-serif;
    color: #2D1E17;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.char-counter.normal {
    opacity: 0.7;
}

.char-counter.warning {
    color: #b45309;
    animation: pulse 1s infinite;
}

.char-counter.danger {
    color: #b91c1c;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ================================================
   FORM FIELD STYLES - Larger fields with icons
   ================================================ */

/* Form group container */
#testimonialForm .form-group {
    margin-bottom: 1.5rem;
}

/* Label styles - Larger text */
#testimonialForm .form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2D1E17;
}

#testimonialForm .form-group label i {
    font-size: 1.2rem;
    color: #78350f;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

/* Input styles - Larger and more prominent */
#testimonialForm input.testimonial-input,
#testimonialForm textarea {
    background-color: #fdf8f3 !important;
    border: 2px solid rgba(45, 30, 23, 0.25) !important;
    color: #2D1E17 !important;
    transition: all 0.3s ease;
    border-radius: 0.6rem;
    padding: 1rem 1.25rem !important;
    font-size: 1.05rem !important;
    width: 100%;
}

#testimonialForm input.testimonial-input::placeholder,
#testimonialForm textarea::placeholder {
    color: rgba(45, 30, 23, 0.5) !important;
    font-size: 1rem !important;
}

/* Input focus */
#testimonialForm input.testimonial-input:focus,
#testimonialForm textarea:focus {
    background-color: #fff !important;
    border-color: #2D1E17 !important;
    box-shadow: 
        0 0 0 4px rgba(45, 30, 23, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.1) !important;
    outline: none;
    transform: translateY(-1px);
}

/* Input hover */
#testimonialForm input.testimonial-input:hover,
#testimonialForm textarea:hover {
    background-color: #faf3e8 !important;
    border-color: rgba(45, 30, 23, 0.4) !important;
}

/* Browser autofill fix - Chrome/Safari/Edge */
#testimonialForm input.testimonial-input:-webkit-autofill,
#testimonialForm input.testimonial-input:-webkit-autofill:hover,
#testimonialForm input.testimonial-input:-webkit-autofill:focus,
#testimonialForm input.testimonial-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #fdf8f3 inset !important;
    -webkit-text-fill-color: #2D1E17 !important;
    color: #2D1E17 !important;
    font-size: 1.05rem !important;
}

/* Firefox autofill */
#testimonialForm input.testimonial-input:-moz-autofill,
#testimonialForm input.testimonial-input:-moz-autofill:hover,
#testimonialForm input.testimonial-input:-moz-autofill:focus {
    background-color: #fdf8f3 !important;
    color: #2D1E17 !important;
    font-size: 1.05rem !important;
}

/* Textarea with character counter */
#testimonialComment {
    position: relative;
    padding-bottom: 40px !important;
    min-height: 140px;
}

/* ================================================
   ENHANCED STAR RATING
   ================================================ */

.star-rating {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%);
    border-radius: 0.6rem;
    border: 2px solid rgba(45, 30, 23, 0.2);
    position: relative;
}

.star-rating::before {
    content: '⭐';
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 1.2rem;
    background: #d4b488;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

#testimonialForm .star-btn {
    color: rgba(45, 30, 23, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 2.2rem;
    padding: 0.3rem;
}

#testimonialForm .star-btn:hover {
    color: #b45309;
    transform: scale(1.2) rotate(10deg);
}

#testimonialForm .star-btn.active {
    color: #b45309;
    text-shadow: 0 0 15px rgba(180, 83, 9, 0.5);
    transform: scale(1.1);
}

/* Rating labels */
.rating-label {
    display: block;
    text-align: center;
    margin-top: 0.75rem;
    font-size: 1rem;
    color: #2D1E17;
    opacity: 0.85;
    font-style: italic;
    min-height: 1.75rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.rating-label.active {
    opacity: 1;
    font-weight: 700;
    color: #78350f;
}

/* ================================================
   LABELS - Larger text
   ================================================ */

#testimonialForm label {
    color: #2D1E17 !important;
    font-weight: 700;
    font-size: 1.1rem;
}

#testimonialForm .text-accent {
    color: #78350f !important;
    font-weight: 600;
}

/* Form title styling */
#testimonialForm h3,
#testimonialForm .form-title {
    color: #2D1E17 !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
}

/* ================================================
   SUBMIT BUTTON - Inside form
   ================================================ */

#testimonialForm button[type="submit"] {
    background: linear-gradient(145deg, #2D1E17 0%, #4a3428 50%, #2D1E17 100%) !important;
    color: #EAC796 !important;
    font-weight: 700;
    border: none;
    border-radius: 0.6rem;
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
    /* Center the button */
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    min-width: 250px;
}

#testimonialForm button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#testimonialForm button[type="submit"]:hover::before {
    left: 100%;
}

#testimonialForm button[type="submit"]:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(45, 30, 23, 0.4),
        0 0 20px rgba(207, 170, 121, 0.3);
}

#testimonialForm button[type="submit"] i {
    margin-left: 10px;
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

#testimonialForm button[type="submit"]:hover i {
    transform: translateX(4px);
}

/* ================================================
   FORM CONTAINER ANIMATION
   ================================================ */

#testimonialFormContainer.hidden {
    display: none;
}

#testimonialFormContainer:not(.hidden) {
    animation: formSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================
   FORM FEEDBACK - Attractive styling
   ================================================ */

#testimonialFeedback {
    background: linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%) !important;
    border-radius: 0.6rem;
    border-right: 4px solid;
    padding: 1.25rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* Add margin for sides */
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

#testimonialFeedback.feedback-success {
    border-right-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
}

#testimonialFeedback.feedback-error {
    border-right-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
}

#testimonialFeedback.feedback-warning {
    border-right-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    #testimonialForm {
        padding: 1.5rem 1.5rem 1.5rem 1.5rem !important;
        border-radius: 0.5rem;
    }
    
    .star-rating {
        padding: 1rem;
    }
    
    #testimonialForm button[type="submit"] {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        width: 100%;
        min-width: unset;
    }
    
    #testimonialForm::before,
    #testimonialForm::after {
        width: 50px;
        height: 50px;
    }
    
    #testimonialForm input.testimonial-input,
    #testimonialForm textarea {
        padding: 0.875rem 1rem !important;
        font-size: 1rem !important;
    }
    
    #testimonialForm .form-group label {
        font-size: 1rem;
    }
}
