/* Comments Section Styles */
#comments-section {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--surface-card, rgba(255, 255, 255, 0.6));
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

#comments-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-heading, #1a202c);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-light, rgba(0, 0, 0, 0.1));
    padding-bottom: 1rem;
}

#comments-section h3 {
    font-size: 1.5rem;
    color: var(--text-heading, #1a202c);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-body, #4a5568);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.2));
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color, #2d9cdb);
    box-shadow: 0 0 0 3px var(--focus-outline, rgba(45, 156, 219, 0.1));
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted, #718096);
    font-size: 0.875rem;
}

#submit-btn {
    background: var(--primary-color, #2d9cdb);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#submit-btn:hover:not(:disabled) {
    background: var(--darker-blue, #0055aa);
}

#submit-btn:disabled {
    background: var(--text-disabled, #a0aec0);
    cursor: not-allowed;
}

#form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    font-weight: 500;
}

#form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
    border: 1px solid var(--success-color, #10b981);
}

#form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color, #ef4444);
    border: 1px solid var(--error-color, #ef4444);
}

#comments-list {
    margin-top: 3rem;
}

.comment {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color, #2d9cdb);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author {
    color: var(--text-heading, #1a202c);
    font-weight: 600;
}

.comment-date {
    color: var(--text-muted, #718096);
    font-size: 0.875rem;
}

.comment-content {
    color: var(--text-body, #4a5568);
    line-height: 1.6;
    white-space: pre-wrap;
    margin-bottom: 0.75rem;
}

.reply-btn {
    background: transparent;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.2));
    color: var(--primary-color, #2d9cdb);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reply-btn:hover {
    background: var(--primary-color, #2d9cdb);
    color: white;
    border-color: var(--primary-color, #2d9cdb);
}

.reply-btn i {
    margin-right: 0.25rem;
}

.reply-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--surface-elevated, rgba(255, 255, 255, 0.8));
    border-radius: 6px;
    border: 1px solid var(--border-light, rgba(0, 0, 0, 0.1));
}

.reply-form-container .form-group {
    margin-bottom: 0.75rem;
}

.reply-form-container input,
.reply-form-container textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-medium, rgba(0, 0, 0, 0.2));
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
}

.reply-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-submit-reply,
.btn-cancel-reply {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit-reply {
    background: var(--primary-color, #2d9cdb);
    color: white;
}

.btn-submit-reply:hover:not(:disabled) {
    background: var(--darker-blue, #0055aa);
}

.btn-submit-reply:disabled {
    background: var(--text-disabled, #a0aec0);
    cursor: not-allowed;
}

.btn-cancel-reply {
    background: var(--border-medium, rgba(0, 0, 0, 0.2));
    color: var(--text-body, #4a5568);
}

.btn-cancel-reply:hover {
    background: var(--border-medium, rgba(0, 0, 0, 0.3));
}

.reply-message {
    margin-top: 0.75rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.reply-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
    border: 1px solid var(--success-color, #10b981);
}

.reply-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color, #ef4444);
    border: 1px solid var(--error-color, #ef4444);
}

.replies {
    margin-top: 1rem;
    margin-left: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-light, rgba(0, 0, 0, 0.1));
}

.comment.reply {
    background: var(--surface-elevated, rgba(255, 255, 255, 0.8));
    border-left: 2px solid var(--secondary-color, #56ccf2);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.no-comments {
    text-align: center;
    color: var(--text-muted, #718096);
    font-style: italic;
    padding: 2rem;
}

.error {
    color: var(--error-color, #ef4444);
    text-align: center;
    padding: 1rem;
}

/* Mobile Responsive Styles for Comments */
@media (max-width: 768px) {
    #comments-section {
        padding: 1rem;
        margin: 2rem auto;
    }

    #comments-section h2 {
        font-size: 1.5rem;
    }

    #comments-section h3 {
        font-size: 1.25rem;
    }

    .comment {
        padding: 1rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .comment-date {
        font-size: 0.75rem;
    }

    .comment-content {
        font-size: 0.9rem;
    }

    /* Touch-friendly reply button */
    .reply-btn {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        min-height: 44px;
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Reduce reply indentation on mobile */
    .replies {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }

    .comment.reply {
        padding: 0.75rem;
    }

    /* Reply form optimization */
    .reply-form-container {
        padding: 0.75rem;
    }

    .reply-form-container input,
    .reply-form-container textarea {
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }

    .reply-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-submit-reply,
    .btn-cancel-reply {
        width: 100%;
        padding: 0.75rem;
        min-height: 44px;
    }

    /* Main comment form */
    .form-group input,
    .form-group textarea {
        font-size: 1rem; /* Prevent iOS zoom on focus */
    }

    #submit-btn {
        width: 100%;
        min-height: 44px;
    }
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    #comments-section {
        padding: 1.5rem;
    }

    .replies {
        margin-left: 1rem;
    }
}
