/* 
 * Feedback Carousel Custom Styling
 * Ensures consistent sizing regardless of content length
 */

.testimonial-carousel {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: url('../../img/testimonial-bg.png') no-repeat center center;
    background-size: cover;
    padding: 20px;
    border-radius: 25px;
    border: .6px solid #fdffd5;
    box-shadow: 0 0 1px rgba(212, 211, 211, 0.912);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overflow: hidden;
    margin-top: 20px;
    min-height: 300px; /* Increased minimum height */
}

.carousel-inner {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 250px; /* Increased minimum height */
    height: 100%; /* Ensure full height */
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    display: flex;
    flex-direction: column;
    will-change: transform, opacity;
    visibility: hidden;
    pointer-events: none;
}

.carousel-item.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Previous item animation */
.carousel-item.prev {
    opacity: 0;
    transform: translateX(-30px);
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    position: relative; /* Ensure stable positioning */
    z-index: 2; /* Keep above transition */
}

.feedback-name {
    font-weight: bold;
    color: var(--brand-primary);
    font-size: 1.3em;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 15px;
    border-radius: 20px;
    position: relative; /* Ensure stable positioning */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-date {
    color: #fff;
    font-size: 0.9em;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 3px 10px;
    border-radius: 10px;
    position: relative; /* Ensure stable positioning */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feedback-comment {
    margin: 35px 0;
    flex: 1;
    min-height: 100px; /* Fixed minimum height for comments */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    font-size: 1.45em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding: 10px;
    font-weight: 400;
    line-height: 1.3;
    position: relative; /* Ensure stable positioning */
    z-index: 2; /* Keep above transition */
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.feedback-stars {
    color: #f8ce0b;
    font-size: 1.6em;
    text-align: center;
    margin-top: auto;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
    letter-spacing: 3px;
    position: relative; /* Ensure stable positioning */
    z-index: 2; /* Keep above transition */
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* Navigation controls */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.169);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.carousel-nav:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    position: relative; /* Ensure stable positioning */
    z-index: 3; /* Keep above transitions */
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(138, 143, 39, 0.3);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.carousel-dot:hover {
    transform: scale(1.2);
    background-color: rgba(138, 143, 39, 0.5);
}

.carousel-dot.active {
    background-color: var(--brand-primary);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(138, 143, 39, 0.3);
}

/* Ensure consistent background size */
.testimonial-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../../img/testimonial-bg.png') no-repeat center center;
    background-size: cover;
    z-index: 0;
}

/* Success animation */
.feedback-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.2em;
    color: #333;
}

.feedback-success.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.feedback-success i {
    color: #4CAF50;
    font-size: 24px;
    margin-right: 10px;
}

/* Add subtle animations to content elements */
.carousel-item.active .feedback-name {
    animation: slideInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.carousel-item.active .feedback-date {
    animation: slideInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.carousel-item.active .feedback-comment {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.carousel-item.active .feedback-stars {
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
} 