/* ========================================
   Now Nested Review System Styles
   ======================================== */

/* Review Container Styles */
.reviews-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(85, 152, 233, 0.1);
    border: 1px solid rgba(85, 152, 233, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(85, 152, 233, 0.15);
}

.reviews-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c5aa0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reviews-count {
    font-size: 14px;
    color: #5598E9;
    background: rgba(85, 152, 233, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 8px;
}

/* Star Rating Styles */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-rating .star {
    font-size: 16px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-rating .star.filled,
.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: #FFD700;
}

.star-rating.interactive .star:hover ~ .star {
    color: #d1d5db;
}

.star-rating-large .star {
    font-size: 20px;
}

.star-rating-small .star {
    font-size: 14px;
}

.star-rating-display .star {
    cursor: default;
}

/* Average Rating Display */
.average-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.average-rating-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c5aa0;
    text-shadow: 0 1px 2px rgba(85, 152, 233, 0.1);
}

.average-rating-text {
    font-size: 14px;
    color: #6b7280;
}

/* Rating Breakdown */
.rating-breakdown {
    margin-bottom: 24px;
}

.rating-breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rating-breakdown-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 80px;
}

.rating-breakdown-bar {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.rating-breakdown-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
}

.rating-breakdown-count {
    min-width: 30px;
    text-align: right;
    font-size: 12px;
    color: #6b7280;
}

/* Individual Review Styles */
.review-item {
    padding: 24px;
    border-bottom: 1px solid rgba(85, 152, 233, 0.1);
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.review-item:hover {
    background: linear-gradient(135deg, rgba(85, 152, 233, 0.02), rgba(118, 167, 210, 0.02));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 152, 233, 0.1);
}

.review-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.review-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5598E9, #76A7D2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(85, 152, 233, 0.3);
}

.review-author-info {
    flex: 1;
}

.review-author-name {
    font-weight: 700;
    color: #2c5aa0;
    font-size: 16px;
    margin: 0 0 2px 0;
}

.review-date {
    font-size: 12px;
    color: #6b7280;
}

.review-rating {
    margin-left: auto;
}

.review-content {
    margin-top: 12px;
}

.review-comment {
    color: #4b5563;
    line-height: 1.6;
    font-size: 14px;
    margin: 0 0 8px 0;
}

.review-stay-duration {
    color: #6b7280;
    font-style: italic;
    font-size: 13px;
    margin: 8px 0;
}

.review-type {
    display: inline-block;
    background: rgba(85, 152, 233, 0.1);
    color: #2c5aa0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    border: 1px solid rgba(85, 152, 233, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-type.tenant-to-owner {
    background: linear-gradient(135deg, rgba(85, 152, 233, 0.1), rgba(118, 167, 210, 0.1));
    color: #2c5aa0;
    border-color: rgba(85, 152, 233, 0.3);
}

.review-type.owner-to-tenant {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    color: #166534;
    border-color: rgba(40, 167, 69, 0.3);
}

.review-type.roommate-to-roommate {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.15));
    color: #B8860B;
    border-color: rgba(255, 215, 0, 0.3);
}

/* Review Form Styles */
.review-form {
    background: linear-gradient(135deg, rgba(85, 152, 233, 0.03), rgba(118, 167, 210, 0.03));
    border: 1px solid rgba(85, 152, 233, 0.15);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(85, 152, 233, 0.08);
}

.review-form-header {
    margin-bottom: 20px;
}

.review-form-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c5aa0;
    margin: 0 0 8px 0;
}

.review-form-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #5598E9;
    box-shadow: 0 0 0 3px rgba(85, 152, 233, 0.15);
    background: rgba(85, 152, 233, 0.02);
}

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

.rating-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rating-input-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

/* Review Actions */
.review-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.review-action-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #ffffff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.review-action-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.review-action-btn.edit {
    color: #5598E9;
    border-color: #5598E9;
    background: rgba(85, 152, 233, 0.05);
}

.review-action-btn.edit:hover {
    background: rgba(85, 152, 233, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(85, 152, 233, 0.2);
}

.review-action-btn.delete {
    color: #ef4444;
    border-color: #ef4444;
}

.review-action-btn.delete:hover {
    background: #fef2f2;
}

/* Empty State */
.reviews-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.reviews-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #d1d5db;
}

.reviews-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.reviews-empty-text {
    font-size: 14px;
    margin: 0;
}

/* Upgrade Prompt for Free Users */
.review-upgrade-prompt {
    background: linear-gradient(135deg, #5598E9 0%, #76A7D2 50%, #A8CCE8 100%);
    color: white;
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(85, 152, 233, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.review-upgrade-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.review-upgrade-text {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 16px 0;
}

.review-upgrade-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.review-upgrade-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    text-decoration: none;
}

/* Modal Styling */
.review-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.review-modal-header {
    background: linear-gradient(135deg, #5598E9, #76A7D2);
    color: white;
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 24px 28px;
}

.review-modal-header .modal-title {
    color: white;
    font-weight: 700;
    font-size: 1.35rem;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.review-modal-body {
    padding: 24px;
}

.review-modal-body .review-form {
    background: transparent;
    padding: 20px;
    margin: 0;
    border-radius: 4px;
}

.review-modal-body .review-form-header {
    display: none; /* Hide duplicate header in modal */
}

/* Button Styling */
.review-btn {
    background: linear-gradient(135deg, #5598E9, #76A7D2);
    border: none;
    color: white;
    padding: 14px 28px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(85, 152, 233, 0.4);
    margin-top: 16px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-btn:hover {
    background: linear-gradient(135deg, #4A8BC2, #5598E9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(85, 152, 233, 0.5);
    color: white;
}

/* Loading Spinner */
.reviews-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6b7280;
}

.reviews-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(85, 152, 233, 0.1);
    border-top: 4px solid #5598E9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(85, 152, 233, 0.2);
}

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

/* Message Styles */
.review-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: between;
    font-size: 14px;
    font-weight: 500;
}

.review-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.review-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.review-message.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

#reviewModal .btn-close,
#editReviewModal .btn-close {
    opacity: 0.8 !important;
    background: transparent;
    position: absolute;
    right: 20px;
    top: 20px;
    color: #fff;
}

#reviewModal .btn-close:focus,
#editReviewModal .btn-close:focus {
    box-shadow: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reviews-container {
        padding: 20px 16px;
        margin-bottom: 20px;
        border-radius: 10px;
    }
    
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding-bottom: 12px;
    }
    
    .reviews-title {
        font-size: 20px;
    }
    
    .review-item {
        padding: 20px 16px;
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .review-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .review-author {
        align-self: stretch;
    }
    
    .review-author-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .review-author-name {
        font-size: 15px;
    }
    
    .review-rating {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .rating-breakdown-item {
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .rating-breakdown-stars {
        min-width: 75px;
    }
    
    .review-form {
        padding: 20px 16px;
        border-radius: 10px;
    }
    
    .btn-review-primary,
    .btn-review-secondary {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .btn-review-sm {
        padding: 8px 12px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .reviews-container {
        padding: 16px 12px;
        margin-bottom: 16px;
    }
    
    .reviews-title {
        font-size: 18px;
    }
    
    .star-rating-large .star {
        font-size: 18px;
    }
    
    .average-rating-value {
        font-size: 24px;
    }
    
    .review-item {
        padding: 16px 12px;
        margin-bottom: 10px;
    }
    
    .review-author-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .review-author-name {
        font-size: 14px;
    }
    
    .review-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .review-action-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .review-form {
        padding: 16px 12px;
    }
    
    .review-upgrade-prompt {
        padding: 20px 12px;
        border-radius: 12px;
    }
    
    .btn-review-primary {
        padding: 10px 16px;
        font-size: 12px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-review-secondary {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .btn-review-lg {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* ========================================
   Standardized Button System for Reviews
   ======================================== */

/* Primary Action Buttons */
.btn-review-primary {
    background: linear-gradient(135deg, #5598E9, #76A7D2);
    border: none;
    color: white;
    padding: 12px 24px;
    font-weight: 700;
    border-radius: 8px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(85, 152, 233, 0.3);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-review-primary:hover {
    background: linear-gradient(135deg, #4A8BC2, #5598E9);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(85, 152, 233, 0.4);
    color: white;
    text-decoration: none;
}

.btn-review-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(85, 152, 233, 0.3);
}

/* Secondary Action Buttons */
.btn-review-secondary {
    background: transparent;
    border: 2px solid #5598E9;
    color: #5598E9;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-review-secondary:hover {
    background: #5598E9;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 152, 233, 0.25);
    text-decoration: none;
}

.btn-review-secondary:active {
    transform: translateY(0);
}

/* Success Action Buttons */
.btn-review-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-review-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* Warning Action Buttons */
.btn-review-warning {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    color: #8B4513;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-review-warning:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    color: #654321;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    text-decoration: none;
}

/* Danger/Delete Action Buttons */
.btn-review-danger {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-review-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
    text-decoration: none;
}

/* Small Button Variants */
.btn-review-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-review-sm.btn-review-primary {
    padding: 8px 16px;
}

/* Large Button Variants */
.btn-review-lg {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: 10px;
}

/* Disabled State */
.btn-review-primary:disabled,
.btn-review-secondary:disabled,
.btn-review-success:disabled,
.btn-review-warning:disabled,
.btn-review-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-review-primary:disabled:hover,
.btn-review-secondary:disabled:hover,
.btn-review-success:disabled:hover,
.btn-review-warning:disabled:hover,
.btn-review-danger:disabled:hover {
    transform: none;
    box-shadow: none;
}

.review-modal-body .review-form .form-group .btn {
    font-size: 16px !important;
    padding: 10px 30px !important;
}

.review-action-fields {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px;
}

.guide_list {
    margin: 8px 0 0 16px; 
    padding: 0;
}

.review-action-btns {
    display: flex; 
    gap: 12px; 
    justify-content: flex-end;
}

@media (max-width: 576px) {
    .review-action-fields {
        display: block !important;
    }
    .review-action-fields div {
        margin-bottom: 12px !important;
    }
    .guide_list {
        margin: 8px 0px !important;
    }
    .review-action-btns {
        display: block !important;
    }
    .review-modal-body .review-form .form-group .btn {
        margin-bottom: 10px;
        width: 100%;
    }
}

@media (max-width: 360px) {
    #profile-tab .container {
        padding: 0px !important;
    }

    .row.profile-content, .profile-content .col-12.mt-5 {
        padding: 0px !important;
    }
}

