/**
 * WP Travel Reviews Public CSS
 */

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes sparkle {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* General styles */
.travel-reviews-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    max-width: 100%;
    margin: 2em auto;
}

.travel-reviews-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 2em;
    margin-bottom: 2em;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeIn 0.6s ease-out;
}

.travel-reviews-form:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Form fields */
.travel-reviews-form h3 {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 1em;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

.form-row {
    margin-bottom: 1.5em;
}

.form-label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    font-size: 0.95em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.form-field input[type="text"]:focus,
.form-field input[type="email"]:focus,
.form-field textarea:focus,
.form-field select:focus {
    border-color: #0693e3;
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 147, 227, 0.1);
}

.form-field textarea {
    min-height: 120px;
    resize: vertical;
}

.form-field input.error,
.form-field textarea.error,
.form-field select.error {
    border-color: #e74c3c;
}

.required-label:after {
    content: "*";
    color: #e74c3c;
    margin-left: 4px;
}

/* Star Rating */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 1em;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 1.8em;
    color: #FFD700;
    transition: all 0.2s ease;
    margin-right: 5px;
}

.star-rating label:before {
    content: "★";
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating label.hover,
.star-rating label.hover ~ label {
    color: #FFD700;
    transform: scale(1.2);
}

.star-rating.error {
    animation: pulse 0.4s ease;
}

.star-rating label.selected {
    animation: sparkle 0.5s ease-in-out;
}

/* File uploads */
.file-upload {
    position: relative;
    margin-bottom: 1em;
}

.file-upload-btn {
    display: inline-block;
    background-color: #f1f1f1;
    color: #333;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
}

.file-upload-btn:hover {
    background-color: #e1e1e1;
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-note {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

/* Preview areas */
#image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1em;
}

.image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

#video-preview,
#video-url-preview {
    margin-top: 1em;
    max-width: 300px;
}

#video-preview video,
#video-url-preview iframe {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form messages */
.form-message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 1em;
    display: none;
}

.form-error {
    background-color: #fce4e4;
    border: 1px solid #e74c3c;
    color: #e74c3c;
}

.form-success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

/* Submit button */
.travel-review-submit {
    background-color: #0693e3;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.travel-review-submit:hover {
    background-color: #0581c7;
}

.travel-review-submit:active {
    transform: translateY(1px);
}

.travel-review-submit.loading {
    position: relative;
    color: transparent;
}

.travel-review-submit.loading:after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
}

/* Reviews list */
.travel-reviews-list {
    margin-top: 2em;
}

.travel-reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}

.travel-reviews-title {
    font-size: 1.5em;
    margin: 0;
    color: #2c3e50;
}

.travel-reviews-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.travel-reviews-filter label {
    margin-right: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.travel-reviews-filter select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

/* Grid layout */
.travel-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* List layout */
.travel-reviews-list-view .travel-review-item {
    margin-bottom: 20px;
}

/* Review item */
.travel-review-item {
    background-color: white;
    border-radius: 8px;
    padding: 1.5em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

.travel-review-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1em;
}

.reviewer-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #2c3e50;
}

.review-date {
    font-size: 0.85em;
    color: #7f8c8d;
}

.review-rating {
    margin-bottom: 0.5em;
}

.review-rating .star {
    color: #FFD700;
    font-size: 1.2em;
}

.review-title {
    font-size: 1.2em;
    margin: 0.5em 0;
    color: #2c3e50;
}

.review-content {
    margin-bottom: 1em;
    line-height: 1.5;
}

/* Review images */
.travel-review-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 1em;
}

.review-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.review-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.review-image:hover img {
    transform: scale(1.1);
}

.review-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.review-image:hover::after {
    opacity: 1;
}

/* Review video */
.travel-review-video {
    position: relative;
    margin-bottom: 1em;
}

.travel-review-video-thumbnail {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 0;
    padding-bottom: 56.25%;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.travel-review-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.travel-review-video-thumbnail::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="50" height="50" fill="white"><path d="M8 5v14l11-7z"/></svg>') center no-repeat;
    transition: background-color 0.3s ease;
}

.travel-review-video-thumbnail:hover::after {
    background-color: rgba(0, 0, 0, 0.5);
}

.travel-review-video-thumbnail.hidden {
    display: none;
}

.travel-review-video-container {
    display: none;
    width: 100%;
    max-width: 500px;
}

.travel-review-video-container.active {
    display: block;
}

.travel-review-video-container iframe,
.travel-review-video-container video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
}

/* Modal for image gallery */
.travel-review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.travel-review-modal.active {
    opacity: 1;
}

.travel-review-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.travel-review-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
}

.travel-review-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    background: transparent;
    border: none;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

/* Pagination */
.travel-reviews-pagination {
    margin-top: 2em;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-numbers {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-numbers:hover {
    background-color: #f5f5f5;
}

.page-numbers.current {
    background-color: #0693e3;
    border-color: #0693e3;
    color: white;
}

/* No reviews message */
.no-reviews {
    background-color: #f8f9fa;
    padding: 2em;
    text-align: center;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

.no-reviews p {
    margin: 0;
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Destination label */
.review-destination {
    display: inline-block;
    background-color: rgba(6, 147, 227, 0.1);
    color: #0693e3;
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 1em;
}

/* Radio buttons for video source */
.video-source-toggle {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    margin-right: 5px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .travel-reviews-form {
        padding: 1.5em;
    }
    
    .travel-reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .travel-reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-date {
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .travel-reviews-form {
        padding: 1em;
    }
    
    .form-row {
        margin-bottom: 1em;
    }
    
    .star-rating label {
        font-size: 1.5em;
    }
}
