/**
 * Luck & Fortune Finance - Comments System Styles
 * Brand: #0ebdf3 (cyan/turquoise), Jost font, glassmorphism cards
 */

/* Comments Section Container */
.comments-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-family: 'Jost', sans-serif;
}

.comments-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.02em;
}

.comment-count-badge {
    background: linear-gradient(135deg, #0ebdf3 0%, #22a5e5 100%);
    color: white;
    font-size: 0.875rem;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(14, 189, 243, 0.3);
}

/* Comments List */
.comments-list {
    margin-bottom: 2.5rem;
}

.comments-loading,
.no-comments,
.comments-error {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
    font-style: italic;
    background: rgba(248, 249, 250, 0.5);
    border-radius: 16px;
    border: 1px dashed rgba(14, 189, 243, 0.2);
}

.comments-error {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
    border-color: rgba(220, 53, 69, 0.2);
}

.no-comments::before {
    content: "💬";
    display: block;
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Individual Comment */
.comment {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.comment-reply {
    margin-left: 3rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 3px solid #0ebdf3;
}

.comment-level-1 { margin-left: 3rem; }
.comment-level-2 { margin-left: 5rem; }
.comment-level-3 { margin-left: 7rem; }

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.625rem;
}

.comment-author {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1.05rem;
}

.comment-date {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 400;
}

.comment-content {
    color: #475569;
    line-height: 1.7;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.comment-content code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875em;
    color: #0ebdf3;
}

.comment-footer {
    margin-top: 1rem;
}

.btn-reply {
    background: transparent;
    border: 1px solid rgba(14, 189, 243, 0.3);
    color: #0ebdf3;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-reply:hover {
    background: #0ebdf3;
    color: white;
    border-color: #0ebdf3;
    box-shadow: 0 4px 15px rgba(14, 189, 243, 0.35);
    transform: translateY(-1px);
}

.comment-replies {
    margin-top: 1.25rem;
}

/* Comment Form */
.comment-form-wrapper {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,250,252,0.9) 100%);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(14, 189, 243, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06),
                0 2px 4px rgba(14, 189, 243, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.comment-form-wrapper h3 {
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form-wrapper h3::before {
    content: "✍️";
    font-size: 1.5rem;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.comment-form .form-group {
    margin-bottom: 1.25rem;
}

.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #334155;
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Jost', sans-serif;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: white;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #0ebdf3;
    box-shadow: 0 0 0 4px rgba(14, 189, 243, 0.12);
}

.comment-form textarea {
    resize: vertical;
    min-height: 140px;
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Honeypot field - hidden */
.honey-pot {
    position: absolute;
    left: -9999px;
}

/* Reply indicator */
.replying-to {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(14, 189, 243, 0.08) 0%, rgba(34, 165, 229, 0.05) 100%);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    border-left: 3px solid #0ebdf3;
}

.replying-to strong {
    color: #0ebdf3;
}

.btn-cancel-reply {
    background: white;
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #dc3545;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel-reply:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Submit Button */
.btn-submit-comment {
    background: linear-gradient(135deg, #0ebdf3 0%, #22a5e5 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(14, 189, 243, 0.35);
    font-family: 'Jost', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit-comment:hover:not(:disabled) {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.btn-submit-comment:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Message */
.comment-message {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
}

.comment-message-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #b1dfbb;
}

.comment-message-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f1b0b7;
}

/* CSP Compliant Utility Classes - Use instead of inline styles */
.d-none {
    display: none !important;
}

.d-inline {
    display: inline !important;
}

.d-flex {
    display: flex !important;
}

.d-block {
    display: block !important;
}

/* Honeypot field - hidden from real users */
.honey-pot {
    position: absolute;
    left: -9999px;
}

/* Responsive */
@media (max-width: 768px) {
    .comment-form .form-row {
        grid-template-columns: 1fr;
    }

    .comment {
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem;
    }

    .comment-avatar img {
        width: 44px;
        height: 44px;
    }

    .comment-reply,
    .comment-level-1,
    .comment-level-2,
    .comment-level-3 {
        margin-left: 1.5rem;
    }

    .comment-form-wrapper {
        padding: 1.75rem;
    }

    .replying-to {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

/* Animation for new comments */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment {
    animation: fadeInUp 0.4s ease-out;
}
