/**
 * Comments Styles
 * Custom styling for WordPress comments with Nutricida theme colors
 */

/* Comments Area */
.comments-area {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comment List */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-list .children {
    list-style: none;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

@media (min-width: 768px) {
    .comment-list .children {
        padding-left: 4rem;
    }
}

/* Comment Item Animation */
.comment-item {
    animation: slideIn 0.4s ease-out;
    transition: all 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(74, 141, 47, 0.15);
}

/* Comment Avatar */
.comment-avatar {
    position: relative;
}

.comment-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a8d2f 0%, #97A626 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.comment-item:hover .comment-avatar::after {
    opacity: 1;
}

/* Comment Author Link */
.comment-author-info a {
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author-info a:hover {
    color: #4a8d2f;
}

/* Reply Link Animation */
.comment-actions a {
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.comment-actions a:hover {
    transform: translateX(-3px);
}

/* Comment Form */
.comment-form {
    position: relative;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    transition: all 0.3s ease;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    outline: none;
}

/* Submit Button */
.comment-form .submit {
    position: relative;
    overflow: hidden;
}

.comment-form .submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.comment-form .submit:hover::before {
    width: 300px;
    height: 300px;
}

.comment-form .submit:active {
    transform: scale(0.98);
}

/* Required Asterisk */
.required {
    font-weight: bold;
}

/* Comment Notes */
.comment-notes {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 100px;
    }
}

/* Logged In As */
.logged-in-as {
    background: #eef9f5;
    border-left: 4px solid #4a8d2f;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.logged-in-as a {
    color: #4a8d2f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.logged-in-as a:hover {
    color: #2d401a;
}

/* Comment Navigation */
.comment-navigation {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* No Comments Message */
.no-comments {
    text-align: center;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    color: #6b7280;
    font-style: italic;
}

/* Pingback & Trackback */
.comment-list .pingback,
.comment-list .trackback {
    background: #f3f4f6;
    border-left: 4px solid #97A626;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.comment-list .pingback p,
.comment-list .trackback p {
    margin: 0;
}

/* Nested Comments Connector */
.comment-list .children::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #4a8d2f 0%, #eef9f5 100%);
    opacity: 0.3;
}

.comment-list .children {
    position: relative;
}

/* Comment Depth Indicators */
.depth-1 { z-index: 10; }
.depth-2 { z-index: 9; }
.depth-3 { z-index: 8; }
.depth-4 { z-index: 7; }
.depth-5 { z-index: 6; }

/* Responsive Adjustments */
@media (max-width: 640px) {
    .comment-author-avatar-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-avatar {
        margin-bottom: 1rem;
    }
    
    .comment-list .children {
        padding-left: 1rem;
    }
    
    .comment-meta .flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-actions {
        margin-top: 0.5rem;
    }
}

/* Print Styles */
@media print {
    .comment-actions,
    .comment-form,
    .comment-navigation {
        display: none !important;
    }
    
    .comments-area {
        box-shadow: none !important;
        border: 1px solid #e5e7eb;
    }
}

/* Accessibility */
.comment-form input:focus-visible,
.comment-form textarea:focus-visible {
    outline: 3px solid #4a8d2f;
    outline-offset: 2px;
}

/* Cancel Reply Link */
#cancel-comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

#cancel-comment-reply-link:hover {
    background: #fca5a5;
    transform: translateY(-2px);
}

/* Form Error States */
.comment-form input.error,
.comment-form textarea.error {
    border-color: #ef4444;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success Message */
.comment-success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.4s ease-out;
}

/* Loading State */
.comment-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.comment-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #eef9f5;
    border-top-color: #4a8d2f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
