/* Card Styles */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(102, 126, 234, 0.05),
        transparent
    );
    transition: left 0.6s ease;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    position: relative;
}

.card-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Rating Summary */
.rating-summary-card .rating-score {
    color: #667eea;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.rating-summary-card .rating-stars i {
    color: #ffc107; /* Warning color for stars */
    font-size: 1.8rem;
    margin: 0 2px;
}

/* Rating Breakdown */
.rating-breakdown .rating-bar {
    margin-bottom: 0.75rem;
}

.rating-breakdown .rating-label {
    font-weight: 600;
    color: #333;
    width: 20px; /* Fixed width for alignment */
    text-align: center;
}

.rating-breakdown .rating-bar .fa-star {
    color: #ffc107;
    font-size: 0.9rem;
}

.rating-breakdown .progress {
    height: 10px;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.rating-breakdown .progress-bar {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border-radius: 50px;
    transition: width 0.6s ease-out;
}

.rating-breakdown .rating-count {
    font-size: 0.9rem;
    color: #666;
    min-width: 40px; /* Ensure consistent spacing */
    text-align: left;
}

/* Add Review Form */
.add-review-card .form-label {
    font-weight: 600;
    color: #333;
}

.add-review-card .form-control,
.add-review-card .form-select {
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
}

.add-review-card .form-control:focus,
.add-review-card .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

.star-rating {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    display: inline-block;
}

.star-rating i {
    margin: 0 5px;
    transition: color 0.2s ease;
}

.star-rating i.fas {
    color: #ffc107;
}

.add-review-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.add-review-btn::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;
}

.add-review-btn:hover::before {
    left: 100%;
}

.add-review-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Reviews List Section */
.reviews-list-section .section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    position: relative;
}

.reviews-list-section .section-title::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #ffd700, #ffb347);
    border-radius: 2px;
}

/* Individual Review Card */
.review-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.review-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(102, 126, 234, 0.03),
        transparent
    );
    transition: left 0.5s ease;
}

.review-card:hover::before {
    left: 100%;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.25);
}

.review-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.user-info .user-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.2rem;
}

.review-stars i {
    color: #ffc107;
    font-size: 1rem;
    margin-left: 2px;
}

.review-comment {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.review-date {
    font-size: 0.85rem;
    color: #777;
}

/* Load More Button */
.load-more-btn {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    background: transparent;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rating-summary-card,
.add-review-card,
.review-card {
    animation: fadeInUp 0.8s ease-out forwards;
}

.review-card {
    animation-delay: var(--animation-delay); /* Controlled by JS */
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
    .card-title {
        font-size: 1.5rem;
    }
    .rating-score {
        font-size: 3rem !important;
    }
    .star-rating {
        font-size: 1.5rem;
    }
    .add-review-btn,
    .load-more-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    .user-info .user-name {
        font-size: 0.95rem;
    }
    .review-stars i {
        font-size: 0.85rem;
    }
    .review-comment {
        font-size: 0.9rem;
    }
}
