/**
 * User Comments System Styles
 * 
 * Styles for user-submitted comments/reviews on destinations and comparisons
 */

/* Auth Modal Styles */
.ts-auth-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.ts-auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-auth-modal-content {
    background-color: #ffffff;
    margin: 20px;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ts-auth-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ts-auth-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #111827;
}

.ts-auth-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.ts-auth-modal-close:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.ts-auth-modal-body {
    padding: 0 24px 24px;
}

.ts-auth-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e5e7eb;
    background: transparent;
    padding: 16px 20px 0;
    margin-bottom: 0;
}

.ts-auth-tab {
    flex: 1;
    padding: 12px 16px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
    letter-spacing: 0;
    box-shadow: none;
    transition: none;
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
    margin-bottom: -1px;
    border-bottom: none;
}

.ts-auth-tab:hover:not(.active) {
    background: #e9ecef;
    border-color: #e5e7eb;
    color: #111827;
}

.ts-auth-tab.active {
    background: var(--color-primary, #f8961e);
    border-color: var(--color-primary, #f8961e);
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.ts-auth-form-container {
    display: none;
}

.ts-auth-form-container.active {
    display: block;
    padding-top: 24px;
}

.ts-auth-form-group {
    margin-bottom: 16px;
}

.ts-auth-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 500;
    font-size: 0.9rem;
}

.ts-auth-form-group input,
.ts-auth-form-group textarea,
.ts-auth-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.ts-auth-form-group input:focus,
.ts-auth-form-group textarea:focus,
.ts-auth-form-group select:focus {
    outline: none;
    border-color: var(--color-secondary, #f8961e);
    box-shadow: 0 0 0 3px rgba(248, 150, 30, 0.1);
}

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

/* Month input specific styling */
.ts-auth-form-group input[type="month"] {
    cursor: pointer;
    color: #374151;
}

.ts-auth-form-group input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ts-auth-form-group input[type="month"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.ts-auth-form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.ts-auth-form-checkbox input[type="checkbox"] {
    width: auto;
}

.ts-auth-form-checkbox label {
    margin: 0;
    font-weight: normal;
    color: #6b7280;
    font-size: 0.9rem;
}

.ts-auth-submit-btn {
    width: 100%;
    padding: 12px 24px;
    background-color: var(--color-primary, #f8961e);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ts-auth-submit-btn:hover {
    background-color: var(--color-primary-dark, #e8861e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 150, 30, 0.3);
}

.ts-auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ts-auth-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.ts-auth-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.ts-auth-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.ts-auth-forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: var(--color-primary, #f8961e);
    text-decoration: none;
    font-size: 0.9rem;
}

.ts-auth-forgot-link:hover {
    text-decoration: underline;
}

.ts-auth-back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.9rem;
}

.ts-auth-back-link:hover {
    color: #111827;
}

/* User Comment Form Styles */
.ts-user-comment-form-wrapper {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.ts-login-prompt {
    text-align: center;
    padding: 32px 24px;
}

.ts-login-prompt h3 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 1.25rem;
}

.ts-login-prompt p {
    margin: 0 0 20px;
    color: #6b7280;
}

.ts-login-prompt-btn {
    display: inline-block;
    padding: 12px 32px;
    background-color: var(--color-primary, #f8961e);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.ts-login-prompt-btn:hover {
    background-color: var(--color-primary-dark, #e8861e);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 150, 30, 0.3);
    color: #ffffff;
}

/* Star Rating Input */
.ts-star-rating-input {
    display: flex;
    gap: 4px;
    font-size: 28px;
    margin-bottom: 8px;
}

.ts-star-rating-input .star {
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.2s;
}

.ts-star-rating-input .star.active,
.ts-star-rating-input .star:hover {
    color: #fbbf24;
}

/* Image Upload Preview */
.ts-image-upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.ts-image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

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

.ts-image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ts-image-preview-remove:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: scale(1.1);
}

/* User Comment Display */
.traveler-comment.user-comment {
    /* border-left: 3px solid var(--color-primary, #f8961e); */
    background: #fffbf5;
}

.comment-user-badge {
    display: inline-block;
    background: var(--color-primary, #f8961e);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 600;
}

.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.comment-action-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.comment-action-btn.delete:hover {
    color: #dc2626;
}

.comment-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.comment-image {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.comment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.comment-image:hover img {
    transform: scale(1.05);
}

/* Character counter */
.ts-char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}

.ts-char-counter.warning {
    color: #f59e0b;
}

.ts-char-counter.error {
    color: #dc2626;
}

/* Edit Comment Modal */
.ts-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ts-edit-modal.active {
    opacity: 1;
    visibility: visible;
}

.ts-edit-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ts-edit-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ts-edit-modal.active .ts-edit-modal-content {
    transform: scale(1);
}

.ts-edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ts-edit-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
    font-weight: 600;
}

.ts-edit-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.ts-edit-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.ts-edit-modal-body {
    padding: 24px;
}

.ts-edit-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.ts-edit-cancel-btn,
.ts-edit-submit-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ts-edit-cancel-btn {
    background: #f3f4f6;
    color: #374151;
}

.ts-edit-cancel-btn:hover {
    background: #e5e7eb;
}

.ts-edit-submit-btn {
    background: var(--color-secondary, #f8961e);
    color: white;
}

.ts-edit-submit-btn:hover {
    background: #e8860e;
}

.ts-edit-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive edit modal */
@media (max-width: 768px) {
    .ts-edit-modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .ts-edit-modal-actions {
        flex-direction: column-reverse;
    }

    .ts-edit-cancel-btn,
    .ts-edit-submit-btn {
        width: 100%;
    }
}
