/* Modern Rating Component Styles */

.rating-component {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Removed: background, border-radius, padding, box-shadow, border, backdrop-filter */
}

/* Removed orange header bar */
.rating-component::before {
    display: none;
}

/* Rating Input Section */
.rating-input {
    text-align: center;
    margin-bottom: 0; /* Removed bottom margin */
}

.rating-label {
    display: none;
    /* Hidden: font-size, font-weight, margin-bottom, color, text-transform, letter-spacing, background, etc. */
}

.stars-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0 0 16px 0; /* Reduced margins */
    padding: 0; /* Removed padding */
}

.star {
    font-size: 42px;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transform-origin: center;
}

.star:hover {
    transform: scale(1.3) rotate(-10deg);
    color: #fbbf24;
    filter: 
        drop-shadow(0 6px 12px rgba(251, 191, 36, 0.4))
        drop-shadow(0 0 20px rgba(251, 191, 36, 0.3));
    animation: starPulse 0.6s ease-in-out;
}

.star.active {
    color: #f59e0b;
    transform: scale(1.1);
    filter: 
        drop-shadow(0 4px 8px rgba(245, 158, 11, 0.4))
        drop-shadow(0 0 15px rgba(245, 158, 11, 0.2));
    animation: starGlow 0.8s ease-in-out;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1.3) rotate(-10deg); }
    50% { transform: scale(1.4) rotate(-15deg); }
}

@keyframes starGlow {
    0%, 100% { 
        filter: 
            drop-shadow(0 4px 8px rgba(245, 158, 11, 0.4))
            drop-shadow(0 0 15px rgba(245, 158, 11, 0.2));
    }
    50% { 
        filter: 
            drop-shadow(0 6px 12px rgba(245, 158, 11, 0.6))
            drop-shadow(0 0 25px rgba(245, 158, 11, 0.4));
    }
}

.user-rating-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50px;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    display: inline-block;
}

.selected-rating {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border-radius: 50px;
    margin-top: 16px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    display: inline-block;
    animation: selectedGlow 1s ease-in-out;
}

@keyframes selectedGlow {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
    50% { 
        box-shadow: 0 6px 16px rgba(245, 158, 11, 0.5);
        transform: translateY(-2px);
    }
}

/* Rating Form Section */
.rating-form {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.save-rating-btn,
.clear-rating-btn {
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 180px;
}

.save-rating-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.save-rating-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.save-rating-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.clear-rating-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.clear-rating-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

/* Comment Input Section */
.comment-input {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.rating-comment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: white;
}

.rating-comment-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.1),
        0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.rating-comment-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

.save-comment-btn,
.clear-comment-btn {
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.save-comment-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.save-comment-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.clear-comment-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.clear-comment-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

/* Rating Summary Section */
.rating-summary {
    padding: 24px;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    margin-top: 24px;
}

.average-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stars-display {
    display: flex;
    gap: 4px;
}

.star-display {
    font-size: 20px;
    color: #d1d5db;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.star-display.filled {
    color: #f59e0b;
    filter: 
        drop-shadow(0 2px 4px rgba(245, 158, 11, 0.3))
        drop-shadow(0 0 8px rgba(245, 158, 11, 0.2));
}

.rating-number {
    font-size: 24px;
    font-weight: 800;
    color: #1f2937;
    background: linear-gradient(135deg, #1f2937, #4b5563);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-count {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* Rating Breakdown */
.rating-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.rating-bar .rating-label {
    min-width: 30px;
    margin: 0;
    font-weight: 600;
    color: #374151;
    text-transform: none;
    letter-spacing: normal;
    background: none;
    -webkit-text-fill-color: initial;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.rating-bar .rating-count {
    min-width: 30px;
    text-align: right;
    font-weight: 600;
    color: #4b5563;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
    border-top: 2px solid #e2e8f0;
    padding-top: 20px;
}

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.comments-header:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.comments-list {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.comment-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.comment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 12px;
    color: #6b7280;
}

.comment-rating {
    display: flex;
    gap: 2px;
}

.star-mini {
    font-size: 16px;
    color: #d1d5db;
}

.star-mini.filled {
    color: #f59e0b;
    filter: drop-shadow(0 1px 2px rgba(245, 158, 11, 0.3));
}

.comment-user {
    font-weight: 600;
    color: #4b5563;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comment-date {
    color: #9ca3af;
    font-size: 11px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    position: relative;
}

.comment-text::before {
    content: '"';
    font-size: 24px;
    color: #3b82f6;
    position: absolute;
    top: 8px;
    left: 8px;
    font-weight: bold;
}

.comment-text::after {
    content: '"';
    font-size: 24px;
    color: #3b82f6;
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-weight: bold;
}

.no-comments {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px 20px;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

/* Messages */
.rating-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 600;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

.rating-message-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.rating-message-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .rating-component {
        padding: 20px;
        border-radius: 16px;
    }
    
    .star {
        font-size: 32px;
    }
    
    .stars-container {
        gap: 8px;
    }
    
    .comment-actions {
        flex-direction: column;
    }
    
    .save-comment-btn,
    .clear-comment-btn {
        width: 100%;
    }
    
    .average-rating {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .rating-component {
        padding: 16px;
        border-radius: 12px;
    }
    
    .star {
        font-size: 28px;
    }
    
    .rating-label {
        font-size: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .rating-component {
        background: linear-gradient(145deg, #1f2937, #111827);
        border-color: #374151;
        color: #f9fafb;
    }
    
    .rating-summary {
        background: linear-gradient(145deg, #374151, #1f2937);
        border-color: #4b5563;
    }
    
    .comment-input {
        background: linear-gradient(145deg, #374151, #1f2937);
        border-color: #4b5563;
    }
    
    .rating-comment-textarea {
        background: #111827;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .comment-item {
        background: #1f2937;
        border-color: #374151;
    }
    
    .comment-text {
        background: linear-gradient(145deg, #374151, #1f2937);
        color: #f9fafb;
    }
}
