/**
 * Community Reviews Locations Plugin Styles
 */

/* Step Form Wrapper */
.crl-review-step-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Step Indicator */
.crl-step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 0 20px;
}

.crl-step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 60px;
    right: 60px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.crl-step-dot {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #999;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.crl-step-dot.active {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
    transform: scale(1.1);
}

.crl-step-dot.completed {
    border-color: #28a745;
    background: #28a745;
    color: #fff;
}

.crl-step-label {
    position: absolute;
    bottom: -25px;
    font-size: 11px;
    white-space: nowrap;
    color: #666;
    font-weight: normal;
}

.crl-step-dot.active .crl-step-label {
    color: #0073aa;
    font-weight: 600;
}

/* Form Steps */
.crl-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.crl-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.crl-step h3 {
    margin-bottom: 25px;
    color: #333;
    font-size: 1.4em;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* Form Fields */
.crl-form-field {
    margin-bottom: 25px;
}

.crl-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.crl-form-field input[type="text"],
.crl-form-field input[type="email"],
.crl-form-field input[type="number"],
.crl-form-field input[type="search"],
.crl-form-field textarea,
.crl-form-field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.crl-form-field input:focus,
.crl-form-field textarea:focus,
.crl-form-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.crl-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.crl-form-field input.crl-field-error,
.crl-form-field textarea.crl-field-error,
.crl-form-field select.crl-field-error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.crl-form-field small {
    color: #666;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

/* Radio Groups */
.crl-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crl-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.crl-radio-label:hover {
    background: #f8f9fa;
    border-color: #0073aa;
}

.crl-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.crl-radio-label input[type="radio"]:checked + span {
    color: #0073aa;
    font-weight: 600;
}

/* Checkbox Labels */
.crl-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.crl-checkbox-label:hover {
    background: #f8f9fa;
}

.crl-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.crl-checkbox-label input[type="checkbox"]:checked + span {
    color: #28a745;
}

/* Rating Sliders (1-5 Scale) */
.crl-rating-slider {
    display: flex;
    align-items: center;
    gap: 15px;
}

.crl-rating-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #ffc107 0%, #ffc107 var(--rating, 60%), #e0e0e0 var(--rating, 60%), #e0e0e0 100%);
    -webkit-appearance: none;
    cursor: pointer;
}

.crl-rating-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0073aa;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.crl-rating-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.crl-rating-slider .rating-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #0073aa;
    min-width: 35px;
    text-align: center;
}

.crl-scale-label {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

/* Experience Textareas */
.crl-experience-textarea {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 3px solid #e0e0e0;
}

.crl-experience-textarea label {
    font-size: 0.9em;
    margin-bottom: 5px;
}

.crl-experience-textarea textarea {
    min-height: 80px;
    font-size: 0.95em;
}

/* Navigation Buttons */
.crl-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.crl-form-navigation .button {
    padding: 12px 25px;
    font-size: 1em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crl-form-navigation .button-primary {
    background: #0073aa;
    color: #fff;
    border: 2px solid #0073aa;
}

.crl-form-navigation .button-primary:hover {
    background: #005a8c;
    border-color: #005a8c;
}

.crl-form-navigation .button-secondary {
    background: #fff;
    color: #666;
    border: 2px solid #ddd;
}

.crl-form-navigation .button-secondary:hover {
    background: #f8f9fa;
    border-color: #999;
}

/* Autocomplete Results */
.crl-autocomplete-results {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    width: calc(100% - 2px);
}

.crl-autocomplete-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crl-autocomplete-results li {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.crl-autocomplete-results li:last-child {
    border-bottom: none;
}

.crl-autocomplete-results li:hover {
    background: #f0f7ff;
}

/* Error Messages */
.crl-error-message {
    color: #dc3545;
    background: #f8d7da;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-top: 15px;
    display: none;
}

/* Thank You Step */
.crl-thank-you-step {
    text-align: center;
    padding: 40px 20px;
}

.crl-thank-you-step h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.crl-thank-you-step p {
    font-size: 1.1em;
    color: #666;
    max-width: 500px;
    margin: 0 auto 30px;
}

.crl-thank-you-step .button {
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    margin: 5px;
}

/* Star Rating Display */
.crl-star-rating {
    display: inline-flex;
    gap: 2px;
}

.crl-star-rating .star {
    font-size: 18px;
    color: #ddd;
}

.crl-star-rating .star.filled {
    color: #ffc107;
}

.crl-star-rating .star.half {
    position: relative;
    color: #ddd;
}

.crl-star-rating .star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    color: #ffc107;
    clip-path: inset(0 50% 0 0);
}

/* Reviews List */
.crl-reviews-list {
    margin-top: 30px;
}

.crl-review-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease;
}

.crl-review-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.crl-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.crl-review-author {
    font-weight: 600;
    color: #333;
}

.crl-review-date {
    color: #999;
    font-size: 0.9em;
}

/* Overall Rating Display for Individual Review */
.crl-review-overall-rating {
    text-align: center;
    background: linear-gradient(135deg, #0073aa 0%, #005a8c 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    min-width: 80px;
}

.crl-review-overall-rating .crl-rating-number {
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
}

.crl-review-overall-rating .crl-rating-max {
    font-size: 0.8em;
    opacity: 0.8;
}

.crl-review-overall-rating .crl-rating-stars {
    margin-top: 5px;
}

.crl-review-overall-rating .crl-rating-stars .star {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.crl-review-overall-rating .crl-rating-stars .star.filled {
    color: #ffc107;
}

/* Individual Review Averages */
.crl-review-averages {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
}

.crl-review-avg-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crl-review-avg-item .crl-avg-label {
    font-size: 0.85em;
    color: #666;
}

.crl-review-avg-item .crl-avg-value {
    font-weight: 600;
    color: #0073aa;
    background: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.crl-review-avg-item .crl-avg-count {
    font-size: 0.8em;
    color: #999;
}

.crl-total-ratings {
    margin-left: auto;
}

.crl-total-ratings .crl-avg-value {
    font-weight: 600;
    color: #28a745;
    background: #e8f5e9;
    font-size: 1em;
}

.crl-avg-stars {
    margin-left: 8px;
}

.crl-avg-stars .star {
    font-size: 14px;
    color: #ddd;
}

.crl-avg-stars .star.filled {
    color: #ffc107;
}

/* Ratings Detail Sections */
.crl-ratings-detail {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.crl-ratings-detail h4 {
    margin: 0 0 10px;
    font-size: 0.95em;
    color: #555;
}

/* Collapsible Sections */
.crl-collapsible-section {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.crl-collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s ease;
}

.crl-collapsible-header:hover {
    background: #e9ecef;
}

.crl-collapsible-header h4 {
    margin: 0;
    font-size: 0.95em;
    color: #333;
}

.crl-toggle-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.crl-collapsible-content {
    display: none;
    padding: 15px;
    background: #fff;
}

.crl-collapsible-content.visible {
    display: block;
}

/* Ratings Group within Collapsible */
.crl-ratings-group {
    margin-bottom: 15px;
}

.crl-ratings-group:last-child {
    margin-bottom: 0;
}

.crl-ratings-group h5 {
    margin: 0 0 10px;
    font-size: 0.9em;
    color: #0073aa;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.crl-review-ratings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.crl-review-rating-item {
    font-size: 0.9em;
}

.crl-review-rating-item .label {
    color: #666;
    margin-right: 8px;
}

.crl-review-rating-item .value {
    font-weight: 600;
    color: #333;
}

.crl-review-content {
    color: #555;
    line-height: 1.6;
    margin: 15px 0;
}

.crl-review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #666;
}

.crl-review-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Location Summary */
.crl-location-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.crl-location-summary h2 {
    margin: 0 0 15px;
    color: #333;
}

.crl-location-address {
    color: #666;
    margin-bottom: 15px;
}

.crl-location-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crl-location-rating .average {
    font-size: 1.5em;
    font-weight: 700;
    color: #0073aa;
}

/* Review Photos */
.crl-review-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.crl-review-photo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.crl-review-photo:hover {
    transform: scale(1.05);
}

/* Button Styles */
.crl-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.crl-button:hover {
    background: #005a8c;
    color: #fff;
    text-decoration: none;
}

.crl-button-secondary {
    background: #fff;
    color: #666;
    border: 2px solid #ddd;
}

.crl-button-secondary:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #999;
}

/* Messages */
.crl-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin: 20px 0;
}

.crl-message.crl-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.crl-message.crl-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ========================================
   Single Location Template Styles
   ======================================== */

.crl-single-location {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.crl-location-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.crl-location-header .crl-stat-stars .star {
    color: rgba(255, 255, 255, 0.7);
}

.crl-location-header .crl-stat-stars .star.filled {
    color: #ffc107;
}

.crl-location-header h1 {
    margin: 0 0 15px;
    font-size: 2.5em;
}

.crl-location-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 1em;
}

.crl-location-type {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.crl-location-address {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 20px;
}

.crl-location-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.crl-stat {
    text-align: center;
}

.crl-stat-value {
    font-size: 2em;
    font-weight: 700;
}

.crl-stat-stars {
    margin: 5px 0;
}

.crl-location-header .crl-stat-stars .star {
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
}

.crl-location-header .crl-stat-stars .star.filled {
    color: #ffc107;
}

.crl-stat-label {
    font-size: 0.9em;
    opacity: 0.8;
}

.crl-rating-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crl-rating-card {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.crl-rating-card h3 {
    margin: 0 0 15px;
    color: #333;
    font-size: 1.1em;
}

.crl-rating-card .rating {
    font-size: 2.5em;
    font-weight: 700;
    color: #0073aa;
}

.crl-rating-card .stars {
    margin: 10px 0;
}

.crl-rating-card .count {
    color: #666;
    font-size: 0.9em;
}

.crl-section {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.crl-section h2 {
    margin: 0 0 20px;
    color: #333;
}

.crl-write-review-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.crl-write-review-btn:hover {
    background: #005a8c;
    color: #fff;
    text-decoration: none;
}

/* ========================================
   Review Actions Styles
   ======================================== */

.crl-review-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.crl-helpful-btn,
.crl-report-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    transition: all 0.2s ease;
}

.crl-helpful-btn:hover,
.crl-report-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.crl-helpful-btn.voted {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.crl-helpful-btn:disabled,
.crl-report-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.crl-already-reported {
    color: #999;
    font-size: 0.9em;
    padding: 8px 16px;
}

.crl-action-message {
    font-size: 0.85em;
    margin-left: 10px;
    animation: fadeIn 0.3s ease;
}

.crl-action-message.crl-success {
    color: #28a745;
}

.crl-action-message.crl-error {
    color: #dc3545;
}

/* Report Modal Styles */
.crl-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crl-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.crl-modal-content {
    position: relative;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.crl-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.crl-modal-close:hover {
    color: #333;
}

.crl-modal-content h3 {
    margin: 0 0 20px;
    color: #333;
    font-size: 1.3em;
}

.crl-report-form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    margin-bottom: 15px;
}

.crl-report-form input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
}

.crl-report-form .button {
    margin-right: 10px;
}

.crl-report-error {
    font-size: 0.9em;
    margin-top: 10px;
}

.crl-report-success {
    text-align: center;
}

.crl-report-success p {
    font-size: 1.1em;
    margin-bottom: 15px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .crl-review-step-form-wrapper {
        padding: 15px;
    }

    .crl-step-indicator {
        padding: 0 10px;
    }

    .crl-step-label {
        font-size: 10px;
    }

    .crl-form-navigation {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .crl-form-navigation .button {
        width: 100%;
        text-align: center;
    }

    .crl-review-ratings {
        grid-template-columns: 1fr;
    }

    .crl-review-header {
        flex-direction: column;
    }

    .crl-location-header {
        padding: 25px;
    }

    .crl-location-header h1 {
        font-size: 1.8em;
    }

    .crl-location-stats {
        gap: 20px;
    }

    .crl-review-actions {
        flex-direction: column;
        gap: 10px;
    }

    .crl-review-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .crl-step-dot {
        width: 30px;
        height: 30px;
        font-size: 0.9em;
    }

    .crl-step-label {
        display: none;
    }

    .crl-step h3 {
        font-size: 1.2em;
    }

    .crl-form-field input[type="text"],
    .crl-form-field input[type="email"],
    .crl-form-field input[type="number"],
    .crl-form-field input[type="search"],
    .crl-form-field textarea,
    .crl-form-field select {
        padding: 10px 12px;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .crl-review-step-form-wrapper {
        max-width: 100%;
    }

    .crl-form-navigation,
    .crl-step-indicator {
        display: none;
    }
}
