/**
 * Comment System Styles
 *
 * Dedicated stylesheet for the Route1Views comment system.
 * Layout utilities have been migrated to Tailwind classes on elements.
 * This file retains: animations, pseudo-elements, JS-toggled states,
 * recursive nesting overrides, and responsive rules.
 */

/* Avatar Edit Button (complex hover + transform) */
.avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--color-rov-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.avatar-edit-btn:hover {
    background: var(--color-rov-green-hover);
    color: white;
    text-decoration: none;
    transform: scale(1.1);
}

/* Comment Image (pseudo-element connectors) */
.comment-image-connection {
    position: relative;
    margin-top: 12px;
    padding-left: 20px;
}

.comment-image-connection::before {
    content: "";
    position: absolute;
    left: 8px;
    top: -12px;
    width: 2px;
    height: 30px;
    background: var(--color-bg-muted);
    border-radius: 1px;
}

.comment-image-connection::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 18px;
    width: 20px;
    height: 2px;
    background: var(--color-bg-muted);
    border-radius: 1px;
}

.comment-image {
    margin-top: 0;
}

.comment-image img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* Like Counter Inner Elements */
.comment-like-counter .like-count {
    font-weight: 600;
    color: var(--color-rov-dark-gray);
}

.comment-like-counter i {
    color: var(--color-rov-green);
    font-size: 14px;
}

.comment-like-counter.liked i {
    color: var(--color-rov-green);
}

/* Like Counter Animations */
@keyframes like-drop-in {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.3) rotate(-10deg);
    }
    50% {
        opacity: 1;
        transform: translateY(3px) scale(1.5) rotate(8deg);
    }
    70% {
        transform: translateY(-2px) scale(0.9) rotate(-5deg);
    }
    85% {
        transform: translateY(1px) scale(1.05) rotate(3deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes like-pulse-wiggle {
    0% {
        transform: scale(1) rotate(0deg);
    }
    10% {
        transform: scale(1.6) rotate(-5deg);
    }
    20% {
        transform: scale(1.8) rotate(5deg);
    }
    30% {
        transform: scale(1.7) rotate(-5deg);
    }
    40% {
        transform: scale(1.8) rotate(4deg);
    }
    50% {
        transform: scale(1.7) rotate(-4deg);
    }
    60% {
        transform: scale(1.4) rotate(2deg);
    }
    75% {
        transform: scale(1.1) rotate(-2deg);
    }
    90% {
        transform: scale(0.95) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.comment-like-counter.animate-drop-in {
    animation: like-drop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comment-like-counter.animate-pulse-wiggle {
    animation: like-pulse-wiggle 0.7s ease-in-out;
}

/* JS-Toggled Like State */
.comment-like-btn.liked {
    color: var(--color-rov-green);
}

.comment-like-btn.liked i {
    color: var(--color-rov-green);
}

/* Threaded Comments - Nested Depth Overrides */
.comment-children .comment-bubble {
    background-color: var(--color-rov-light-gray);
    border-radius: 16px;
}

.comment-children .comment-children {
    margin-left: 2rem;
    border-left-color: var(--color-border);
}

.comment-children .comment-children .comment-bubble {
    background-color: #f1f3f4;
    border-radius: 14px;
}

.comment-children .comment-children .comment-children {
    margin-left: 1.5rem;
    border-left-color: var(--color-border-dark);
    opacity: 0.9;
}

.comment-children .comment-children .comment-children .comment-bubble {
    background-color: var(--color-bg-muted);
    border-radius: 12px;
}

.comment-children .comment-children .comment-children .comment-actions {
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
    margin-top: 8px;
}

/* Timestamp Display Control */
.comment-timestamp-short {
    display: none;
}

.comment-timestamp-long {
    display: inline;
}

/* Mobile Styles */
@media (max-width: 767px) {
    .comment-author {
        font-size: 14px;
        margin-bottom: 2px;
    }

    .comment-bubble {
        padding: 10px 14px;
    }

    .comment-actions {
        bottom: -14px;
    }

    /* Show short timestamp, hide long timestamp */
    .comment-timestamp-short {
        display: inline;
    }

    .comment-timestamp-long {
        display: none;
    }

    /* Hide button text on mobile for Add Photo and Cancel buttons only */
    .comment-form-container .form-actions-left .btn-text,
    .comment-form-container .cancel-reply-btn .btn-text {
        display: none;
    }

    .comment-form-container .cancel-reply-btn .fas {
        margin: 0 !important;
    }

    /* Keep submit button text visible on mobile */
    .comment-form-container .submit-comment-btn .btn-text {
        display: inline;
    }
}
