/**
 * Reviews Component CSS
 * Optional additional styles for the reviews component
 * Include this after the main reviews-site-integrated.css
 */

/* Component-specific enhancements */
.reviews-component-wrapper {
    position: relative;
    width: 100%;
}

/* Enhanced loading states */
.reviews-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.dark-mode-active .reviews-loading-overlay {
    background: rgba(45, 45, 45, 0.9);
}

/* Enhanced vote button states */
.vote-btn.voted {
    background-color: #4DBCDD !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(77, 188, 221, 0.3);
}

.vote-btn.voted:hover {
    background-color: #3aa3c7 !important;
}

/* Review menu enhancements */
.review-menu-btn {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.review-menu-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode-active .review-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced modal animations */
@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.reviews-modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Star rating enhancements */
.star-rating .star {
    transition: all 0.2s ease;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
}

.star-rating .star:hover {
    transform: scale(1.1);
}

/* Form enhancements with size constraints */
.reviews-modal input:focus,
.reviews-modal textarea:focus,
.reviews-modal select:focus {
    outline: none;
    border-color: #4DBCDD;
    box-shadow: 0 0 0 3px rgba(77, 188, 221, 0.1);
}

.reviews-modal textarea {
    max-height: 300px;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.reviews-modal input[type="text"] {
    max-width: 100%;
}

/* Image upload constraints */
.review-image-preview {
    max-width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.review-image-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
}

.dark-mode-active .review-image-container {
    background: #3a3a3a;
    border-color: #555;
}

/* Button enhancements */
.reviews-modal button {
    transition: all 0.2s ease;
    font-family: inherit;
}

.reviews-modal button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reviews-modal button:active {
    transform: translateY(0);
}

/* Character counter and text area limits */
.form-group {
    position: relative;
}

.review-textarea {
    max-height: 300px;
    min-height: 100px;
    resize: vertical;
    max-width: 100%;
    font-family: inherit;
    line-height: 1.5;
}

.review-title-input {
    max-length: 100;
}

.char-counter {
    font-size: 12px;
    text-align: right;
    margin-top: 4px;
    transition: color 0.2s ease;
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.dark-mode-active .char-counter {
    background: rgba(45, 45, 45, 0.9);
    color: #ccc;
}

.char-counter.warning {
    color: #ff6600;
    font-weight: 600;
    background: rgba(255, 102, 0, 0.1);
}

.char-counter.error {
    color: #dc3545;
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
}

.char-counter.success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

/* Text length limits */
.review-content-limited {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.review-content-limited::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
}

.dark-mode-active .review-content-limited::after {
    background: linear-gradient(transparent, rgba(45, 45, 45, 0.8));
}

/* Message enhancements */
.review-message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    backdrop-filter: blur(8px);
    border-left: 4px solid;
}

.review-message.success {
    border-left-color: #28a745;
}

.review-message.error {
    border-left-color: #dc3545;
}

.review-message.info {
    border-left-color: #17a2b8;
}

/* Responsive enhancements with size constraints */
@media (max-width: 768px) {
    .reviews-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .review-menu {
        min-width: 120px;
        font-size: 14px;
    }
    
    .review-menu-item {
        padding: 8px 12px;
    }
    
    .review-textarea {
        max-height: 200px;
        min-height: 80px;
    }
    
    .review-image-preview {
        max-width: 120px;
        max-height: 90px;
    }
    
    .review-image-container {
        max-height: 120px;
    }
    
    .char-counter {
        position: static;
        margin-top: 5px;
        text-align: left;
    }
}

/* Dark mode specific enhancements with size constraints */
.dark-mode-active .reviews-modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
    border: 1px solid #444;
    max-height: 90vh;
    overflow-y: auto;
}

.dark-mode-active .reviews-modal h2,
.dark-mode-active .reviews-modal h3 {
    color: #e0e0e0;
}

.dark-mode-active .reviews-modal input,
.dark-mode-active .reviews-modal textarea,
.dark-mode-active .reviews-modal select {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode-active .reviews-modal input:focus,
.dark-mode-active .reviews-modal textarea:focus,
.dark-mode-active .reviews-modal select:focus {
    border-color: #4DBCDD;
    box-shadow: 0 0 0 3px rgba(77, 188, 221, 0.2);
}

.dark-mode-active .review-textarea {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
    scrollbar-width: thin;
    scrollbar-color: #555 #3a3a3a;
}

.dark-mode-active .review-textarea::-webkit-scrollbar {
    width: 8px;
}

.dark-mode-active .review-textarea::-webkit-scrollbar-track {
    background: #3a3a3a;
}

.dark-mode-active .review-textarea::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.dark-mode-active .review-menu {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

.dark-mode-active .review-menu-item:hover {
    background-color: #444;
}

/* Accessibility enhancements */
.reviews-modal button:focus,
.vote-btn:focus,
.review-menu-btn:focus {
    outline: 2px solid #4DBCDD;
    outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
.vote-btn,
.filter-group select,
.filter-group input,
.review-menu-item {
    transition: all 0.2s ease;
}

/* Loading spinner for buttons */
.button-loading {
    position: relative;
    color: transparent !important;
}

.button-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Content size validation styling */
.content-too-long {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2) !important;
}

.content-size-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dark-mode-active .content-size-warning {
    background: #3d3020;
    border-color: #5d4f37;
    color: #f5d76e;
}

.content-size-warning::before {
    content: '⚠️';
    font-size: 1.1em;
}

/* Expand/collapse for long content */
.review-content-expandable {
    position: relative;
}

.review-content-expandable.collapsed {
    max-height: 200px;
    overflow: hidden;
}

.review-content-expandable.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(255, 255, 255, 1));
    pointer-events: none;
}

.dark-mode-active .review-content-expandable.collapsed::after {
    background: linear-gradient(transparent, rgba(45, 45, 45, 1));
}

.expand-toggle {
    background: #4DBCDD;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin-top: 8px;
    transition: background 0.2s ease;
}

.expand-toggle:hover {
    background: #3aa3c7;
}

.dark-mode-active .expand-toggle {
    background: #4DBCDD;
}

.dark-mode-active .expand-toggle:hover {
    background: #3aa3c7;
}